Skip to content

Commit

Permalink
Fix weird double shutdown bug
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tmolitor-stud-tu committed Dec 29, 2024
1 parent 4093b74 commit 2863725
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Monal/Classes/MonalAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2863725

Please sign in to comment.