Skip to content

Commit

Permalink
GUI: Don't list available engines if this is too slow
Browse files Browse the repository at this point in the history
  • Loading branch information
lephilousophe committed Jun 30, 2024
1 parent ef54303 commit 72f7cc1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gui/about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,20 @@ AboutDialog::AboutDialog(bool inGame)
addLine(engines);

Common::StringArray enginesDetected;

uint32 beginTime = g_system->getMillis(true);
#if defined(UNCACHED_PLUGINS) && defined(DYNAMIC_MODULES) && !defined(DETECTION_STATIC)
// Unload all MetaEnginesDetection if we're using uncached plugins to save extra memory.
if (!inGame) PluginMan.unloadDetectionPlugin();
#endif
if (!inGame) PluginMan.loadFirstPlugin();
do {
uint32 currentTime = g_system->getMillis(true);
if (currentTime - beginTime > 1500) {
// Too slow
enginesDetected.clear();
break;
}
const PluginList &plugins = EngineMan.getPlugins(PLUGIN_TYPE_ENGINE);
for (PluginList::const_iterator iter = plugins.begin(); iter != plugins.end(); ++iter) {
enginesDetected.push_back((*iter)->getName());
Expand Down

0 comments on commit 72f7cc1

Please sign in to comment.