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
This commit is contained in:
parent
457127d2a6
commit
fdc2a2cd81
4 changed files with 28 additions and 3 deletions
|
@ -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 ?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue