Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9454 from JosJuice/android-ingame-settings-save
Android: Fix in-game settings changes not getting saved
  • Loading branch information
leoetlino committed Jan 27, 2021
2 parents b886c70 + 5978550 commit 70447d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/Android/jni/NativeConfig.cpp
Expand Up @@ -128,7 +128,12 @@ 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)
{
return GetLayer(layer, {})->Save();
const std::shared_ptr<Config::Layer> layer_ptr = GetLayer(layer, {});

// Workaround for the Settings class carrying around a legacy map of settings it always saves
layer_ptr->MarkAsDirty();

return layer_ptr->Save();
}

JNIEXPORT jboolean JNICALL
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Common/Config/Layer.h
Expand Up @@ -138,6 +138,8 @@ class Layer
m_map.insert_or_assign(location, std::move(new_value));
}

void MarkAsDirty() { m_is_dirty = true; }

Section GetSection(System system, const std::string& section);
ConstSection GetSection(System system, const std::string& section) const;

Expand Down

0 comments on commit 70447d0

Please sign in to comment.