diff --git a/Monal/Classes/HelperTools.m b/Monal/Classes/HelperTools.m index 779f03514..783deaaea 100644 --- a/Monal/Classes/HelperTools.m +++ b/Monal/Classes/HelperTools.m @@ -1880,11 +1880,14 @@ +(void) flushLogsWithTimeout:(double) timeout +(void) signalSuspension { - DDLogVerbose(@"Suspending logger queue..."); - [HelperTools flushLogsWithTimeout:0.100]; @synchronized(_suspensionHandlingLock) { - dispatch_suspend([DDLog loggingQueue]); - _suspensionHandlingIsSuspended = YES; + if(!_suspensionHandlingIsSuspended) + { + DDLogVerbose(@"Suspending logger queue..."); + [HelperTools flushLogsWithTimeout:0.100]; + dispatch_suspend([DDLog loggingQueue]); + _suspensionHandlingIsSuspended = YES; + } } DDLogVerbose(@"Posting kMonalIsFreezed notification now..."); [[NSNotificationCenter defaultCenter] postNotificationName:kMonalIsFreezed object:nil];