Skip to content

Commit

Permalink
Fix Xcode 16 crash on app startup
Browse files Browse the repository at this point in the history
  • Loading branch information
fysteven committed Sep 25, 2024
1 parent 6a1e392 commit ea4849e
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,18 @@ - (void)_registerSubclassesInLoadedBundle:(NSBundle *)bundle {
- (void)_registerSubclassesInBundle:(NSBundle *)bundle {
PFConsistencyAssert(bundle.loaded, @"Cannot register subclasses in an unloaded bundle: %@", bundle);

const char *executablePath = bundle.executablePath.UTF8String;
[self _registerSubclassesInExecutablePath:bundle.executablePath];

#if defined(DEBUG) && DEBUG
if (bundle == [NSBundle mainBundle]) {
NSString *executablePath = [NSString stringWithFormat:@"%@.debug.dylib", bundle.executablePath];
[self _registerSubclassesInExecutablePath:executablePath];
}
#endif
}

- (void)_registerSubclassesInExecutablePath:(NSString *)exePath {
const char *executablePath = exePath.UTF8String;
if (executablePath == NULL) {
return;
}
Expand Down

0 comments on commit ea4849e

Please sign in to comment.