mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Fix a crash when the ClientProxy is freed. (#3090)
This commit is contained in:
@@ -288,11 +288,14 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
restartTask = nil
|
restartTask = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
Task {
|
// Capture the sync service strongly as this method is called on deinit and so the
|
||||||
|
// existence of self when the Task executes is questionable and would sometimes crash.
|
||||||
|
Task { [syncService] in
|
||||||
do {
|
do {
|
||||||
defer {
|
defer {
|
||||||
completion?()
|
completion?()
|
||||||
}
|
}
|
||||||
|
|
||||||
try await syncService?.stop()
|
try await syncService?.stop()
|
||||||
} catch {
|
} catch {
|
||||||
MXLog.error("Failed stopping the sync service with error: \(error)")
|
MXLog.error("Failed stopping the sync service with error: \(error)")
|
||||||
|
|||||||
Reference in New Issue
Block a user