From fdc2a2cd81ca3547f72a21a12c23ee56cf50faa4 Mon Sep 17 00:00:00 2001 From: Yotam Barnoy Date: Mon, 15 Nov 2010 13:37:06 +0000 Subject: CONFIGMAN: added defragmentation methods for one-plugin-at-a-time One-plugin-at-a-time can have fragmentation caused by the ConfigManager if a game changes any configuration value. By reallocating and copying over the ConfigManager, we avoid this problem. svn-id: r54243 --- base/main.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'base/main.cpp') diff --git a/base/main.cpp b/base/main.cpp index 900d73a28d..44b0aa908d 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -408,6 +408,8 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { #if defined(ONE_PLUGIN_AT_A_TIME) && defined(DYNAMIC_MODULES) // do our best to prevent fragmentation by unloading as soon as we can PluginManager::instance().unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); + // reallocate the config manager to get rid of any fragmentation + ConfMan.defragment(); #endif // Did an error occur ? -- cgit v1.2.3