mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-01-31 01:25:18 +01:00
Fix deadlock in games_config
This commit is contained in:
@@ -66,7 +66,7 @@ bool games_config::add_game(const std::string& key, const std::string& path)
|
||||
|
||||
if (m_save_on_dirty)
|
||||
{
|
||||
return save();
|
||||
return save_nl();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -90,10 +90,8 @@ bool games_config::add_external_hdd_game(const std::string& key, std::string& pa
|
||||
return false;
|
||||
}
|
||||
|
||||
bool games_config::save()
|
||||
bool games_config::save_nl()
|
||||
{
|
||||
std::lock_guard lock(m_mutex);
|
||||
|
||||
YAML::Emitter out;
|
||||
out << m_games;
|
||||
|
||||
@@ -109,6 +107,12 @@ bool games_config::save()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool games_config::save()
|
||||
{
|
||||
std::lock_guard lock(m_mutex);
|
||||
return save_nl();
|
||||
}
|
||||
|
||||
void games_config::load()
|
||||
{
|
||||
std::lock_guard lock(m_mutex);
|
||||
|
||||
@@ -21,6 +21,7 @@ public:
|
||||
bool save();
|
||||
|
||||
private:
|
||||
bool save_nl();
|
||||
void load();
|
||||
|
||||
std::map<std::string, std::string> m_games;
|
||||
|
||||
Reference in New Issue
Block a user