diff --git a/base/main.cpp b/base/main.cpp index bc97df25e22..8130c1fe648 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -457,6 +457,11 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { if (Base::processSettings(command, settings, res)) { if (res.getCode() != Common::kNoError) warning("%s", res.getDesc().c_str()); + + PluginManager::instance().unloadDetectionPlugin(); + PluginManager::instance().unloadAllPlugins(); + PluginManager::destroy(); + return res.getCode(); }