mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 00:25:19 +00:00
Fix thread safety crash in BluetoothMeshService
- Fix race condition where recentlySentMessages Set was being modified from different queues - Move all Set.remove operations to messageQueue instead of main queue - Prevents EXC_BREAKPOINT crash when removing elements during concurrent access
This commit is contained in:
@@ -536,7 +536,7 @@ class BluetoothMeshService: NSObject {
|
||||
self.recentlySentMessages.insert(msgID)
|
||||
|
||||
// Clean up old entries after 10 seconds
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 10.0) { [weak self] in
|
||||
self.messageQueue.asyncAfter(deadline: .now() + 10.0) { [weak self] in
|
||||
self?.recentlySentMessages.remove(msgID)
|
||||
}
|
||||
|
||||
@@ -634,7 +634,7 @@ class BluetoothMeshService: NSObject {
|
||||
self.recentlySentMessages.insert(msgID)
|
||||
|
||||
// Clean up after 10 seconds
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 10.0) { [weak self] in
|
||||
self.messageQueue.asyncAfter(deadline: .now() + 10.0) { [weak self] in
|
||||
self?.recentlySentMessages.remove(msgID)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user