diff options
Diffstat (limited to 'Source/Android/jni/Config/NativeConfig.cpp')
| -rw-r--r-- | Source/Android/jni/Config/NativeConfig.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/Android/jni/Config/NativeConfig.cpp b/Source/Android/jni/Config/NativeConfig.cpp index 9681f0ca8e..f8b9397930 100644 --- a/Source/Android/jni/Config/NativeConfig.cpp +++ b/Source/Android/jni/Config/NativeConfig.cpp @@ -11,6 +11,7 @@ #include "Core/ConfigLoaders/GameConfigLoader.h" #include "Core/ConfigLoaders/IsSettingSaveable.h" #include "jni/AndroidCommon/AndroidCommon.h" +#include "jni/Host.h" constexpr jint LAYER_BASE_OR_CURRENT = 0; constexpr jint LAYER_BASE = 1; @@ -122,6 +123,7 @@ Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_loadGameInis jstring jGameId, jint jRevision) { + HostThreadLock guard; const std::string game_id = GetJString(env, jGameId); const u16 revision = static_cast<u16>(jRevision); Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision)); @@ -131,6 +133,7 @@ Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_loadGameInis JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_unloadGameInis(JNIEnv*, jclass) { + HostThreadLock guard; Config::RemoveLayer(Config::LayerType::GlobalGame); Config::RemoveLayer(Config::LayerType::LocalGame); } @@ -138,6 +141,7 @@ Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_unloadGameIn JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_save( JNIEnv*, jclass, jint layer) { + HostThreadLock guard; return GetLayer(layer, {})->Save(); } @@ -145,6 +149,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_deleteAllKeys(JNIEnv*, jclass, jint layer) { + HostThreadLock guard; return GetLayer(layer, {})->DeleteAllKeys(); } @@ -161,6 +166,7 @@ JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_deleteKey( JNIEnv* env, jclass, jint layer, jstring file, jstring section, jstring key) { + HostThreadLock guard; const Config::Location location = GetLocation(env, file, section, key); const bool had_value = GetLayer(layer, location)->DeleteKey(location); if (had_value) @@ -214,6 +220,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_setString( JNIEnv* env, jclass, jint layer, jstring file, jstring section, jstring key, jstring value) { + HostThreadLock guard; return Set(layer, GetLocation(env, file, section, key), GetJString(env, value)); } @@ -221,18 +228,21 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_setBoolean( JNIEnv* env, jclass, jint layer, jstring file, jstring section, jstring key, jboolean value) { + HostThreadLock guard; return Set(layer, GetLocation(env, file, section, key), static_cast<bool>(value)); } JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_setInt( JNIEnv* env, jclass, jint layer, jstring file, jstring section, jstring key, jint value) { + HostThreadLock guard; return Set(layer, GetLocation(env, file, section, key), value); } JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_setFloat( JNIEnv* env, jclass, jint layer, jstring file, jstring section, jstring key, jfloat value) { + HostThreadLock guard; return Set(layer, GetLocation(env, file, section, key), value); } } |
