From 2863725950688ce4fed481634821f598302f1da1 Mon Sep 17 00:00:00 2001 From: Thilo Molitor Date: Sun, 29 Dec 2024 09:50:29 +0100 Subject: [PATCH] Fix weird double shutdown bug While preapring for app freeze, we reset _shutdownPending to NO. That deactivated the failsafe used to ignore idle states on disconnected accounts and triggered a second shutdown. (But since the app suspension was already triggered (the bg task was terminated), the double shutdown got delayed to next app foreground.) The second shutdown tried to flush the log, but the logging queue was already suspended, so the flushing blocked the main thread indefinitely leading to the iOS watchdog killing the app. This was not visible in any logfiles, because of the suspended logging queue, but our new udp logger force send made it visible. --- Monal/Classes/MonalAppDelegate.m | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Monal/Classes/MonalAppDelegate.m b/Monal/Classes/MonalAppDelegate.m index 2a714ef73..7737cae1b 100644 --- a/Monal/Classes/MonalAppDelegate.m +++ b/Monal/Classes/MonalAppDelegate.m @@ -1135,10 +1135,6 @@ -(void) prepareForFreeze:(NSNotification*) notification [account freeze]; [MLProcessLock unlock]; _wasFreezed = YES; - @synchronized(self) { - DDLogVerbose(@"Setting _shutdownPending to NO..."); - _shutdownPending = NO; - } } -(void) applicationWillEnterForeground:(UIApplication*) application