Skip to content

Commit

Permalink
Fix some apps getting stuck on black screen
Browse files Browse the repository at this point in the history
Based on the backtrace of a hanging log, -[UIScreen mainScreen] would be called at some point in the constructor, causing a deadlock. This commit fixes it by pre-initializing UIScreen.
Apollo and Provenance are now working again. Fixes #14 and #120
  • Loading branch information
khanhduytran0 committed Aug 15, 2024
1 parent 7d0facc commit e53e16f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.m
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ static void exceptionHandler(NSException *exception) {
}

int LiveContainerMain(int argc, char *argv[]) {
// This strangely fixes some apps getting stuck on black screen
NSLog(@"Ignore this: %@", UIScreen.mainScreen);

lcUserDefaults = NSUserDefaults.standardUserDefaults;
NSString *selectedApp = [lcUserDefaults stringForKey:@"selected"];
if (selectedApp) {
Expand Down

0 comments on commit e53e16f

Please sign in to comment.