From f34fb7f8336ffe54a1401bb074ec9247530b07ec Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Thu, 6 Jul 2023 15:55:58 +0700 Subject: [PATCH] Fix: isolated preference initialization --- Natives/LauncherPreferences.m | 5 +++-- Natives/main.m | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Natives/LauncherPreferences.m b/Natives/LauncherPreferences.m index 6135e84d..aa949f61 100644 --- a/Natives/LauncherPreferences.m +++ b/Natives/LauncherPreferences.m @@ -13,12 +13,13 @@ void loadPreferences(BOOL reset) { [pref reset]; } else { pref = [[PLPreferences alloc] initWithAutomaticMigrator]; - pref.instancePath = [NSString stringWithFormat:@"%s/launcher_preferences.plist", getenv("POJAV_GAME_DIR")]; - [pref toggleIsolationForced:NO]; } } void toggleIsolatedPref(BOOL forceEnable) { + if (!pref.instancePath) { + pref.instancePath = [NSString stringWithFormat:@"%s/launcher_preferences.plist", getenv("POJAV_GAME_DIR")]; + } [pref toggleIsolationForced:forceEnable]; } diff --git a/Natives/main.m b/Natives/main.m index f5286d49..ec4fa4e0 100644 --- a/Natives/main.m +++ b/Natives/main.m @@ -346,6 +346,7 @@ int main(int argc, char *argv[]) { init_setupResolvConf(); init_setupMultiDir(); + toggleIsolatedPref(NO); [PLProfiles updateCurrent]; init_setupAccounts(); init_setupCustomControls();