mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 20:43:26 +02:00
Just use g_configs.unload(config) to unload config files.
Avoids concurrent modification errors.
This commit is contained in:
@@ -55,7 +55,6 @@ bool Config::unload()
|
||||
if(isLoaded()) {
|
||||
m_confsDoc = nullptr;
|
||||
m_fileName = "";
|
||||
g_configs.remove(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@@ -117,6 +117,7 @@ bool ConfigManager::unload(const std::string& file)
|
||||
ConfigPtr config = get(file);
|
||||
if(config) {
|
||||
config->unload();
|
||||
remove(config);
|
||||
config = nullptr;
|
||||
return true;
|
||||
}
|
||||
|
@@ -197,7 +197,6 @@ void Application::registerLuaFunctions()
|
||||
// Config
|
||||
g_lua.registerClass<Config>();
|
||||
g_lua.bindClassMemberFunction<Config>("save", &Config::save);
|
||||
g_lua.bindClassMemberFunction<Config>("unload", &Config::unload);
|
||||
g_lua.bindClassMemberFunction<Config>("setValue", &Config::setValue);
|
||||
g_lua.bindClassMemberFunction<Config>("setList", &Config::setList);
|
||||
g_lua.bindClassMemberFunction<Config>("getValue", &Config::getValue);
|
||||
|
Reference in New Issue
Block a user