aboutsummaryrefslogtreecommitdiff
path: root/base/main.cpp
diff options
context:
space:
mode:
authorYotam Barnoy2010-11-15 13:37:06 +0000
committerYotam Barnoy2010-11-15 13:37:06 +0000
commitfdc2a2cd81ca3547f72a21a12c23ee56cf50faa4 (patch)
tree9491240ce9b84a0ea2842f0e1cd87a9f5060dd41 /base/main.cpp
parent457127d2a6aba99a33b3d1212f1406a8c40dc29e (diff)
downloadscummvm-rg350-fdc2a2cd81ca3547f72a21a12c23ee56cf50faa4.tar.gz
scummvm-rg350-fdc2a2cd81ca3547f72a21a12c23ee56cf50faa4.tar.bz2
scummvm-rg350-fdc2a2cd81ca3547f72a21a12c23ee56cf50faa4.zip
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
Diffstat (limited to 'base/main.cpp')
-rw-r--r--base/main.cpp2
1 files changed, 2 insertions, 0 deletions
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 ?