fix crash of dictionary.subscript.getter for closed groups

pull/557/head
Ryan Zhao 3 years ago
parent a101bfbf82
commit ce83de5c46

@ -44,7 +44,7 @@ public final class ClosedGroupPoller : NSObject {
// Might be a race condition that the setUpPolling finishes too soon,
// and the timer is not created, if we mark the group as is polling
// after setUpPolling. So the poller may not work, thus misses messages.
isPolling[groupPublicKey] = true
internalQueue.sync{ isPolling[groupPublicKey] = true }
setUpPolling(for: groupPublicKey)
}
@ -55,7 +55,7 @@ public final class ClosedGroupPoller : NSObject {
}
public func stopPolling(for groupPublicKey: String) {
isPolling[groupPublicKey] = false
internalQueue.sync{ isPolling[groupPublicKey] = false }
timers[groupPublicKey]?.invalidate()
}

Loading…
Cancel
Save