mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Fix call log sending
This commit is contained in:
@@ -717,6 +717,18 @@ public final class OngoingCallContext {
|
||||
}
|
||||
}
|
||||
|
||||
private func withContextThenDeallocate(_ f: @escaping (OngoingCallThreadLocalContextProtocol) -> Void) {
|
||||
self.queue.async {
|
||||
if let contextRef = self.contextRef {
|
||||
let context = contextRef.takeUnretainedValue()
|
||||
f(context.context)
|
||||
|
||||
self.contextRef?.release()
|
||||
self.contextRef = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public func beginTermination() {
|
||||
self.withContext { context in
|
||||
context.nativeBeginTermination()
|
||||
@@ -727,7 +739,7 @@ public final class OngoingCallContext {
|
||||
let account = self.account
|
||||
let logPath = self.logPath
|
||||
|
||||
self.withContext { context in
|
||||
self.withContextThenDeallocate { context in
|
||||
context.nativeStop { debugLog, bytesSentWifi, bytesReceivedWifi, bytesSentMobile, bytesReceivedMobile in
|
||||
debugLogValue.set(.single(debugLog))
|
||||
let delta = NetworkUsageStatsConnectionsEntry(
|
||||
|
||||
Reference in New Issue
Block a user