[Scummvm-git-logs] scummvm master -> 76ac4414ec156882711321acaf61cf5d5e642dd9

bluegr bluegr at gmail.com
Mon Feb 8 01:10:01 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
76ac4414ec BASE: Fix crash when building with uncached plugins and static detection


Commit: 76ac4414ec156882711321acaf61cf5d5e642dd9
    https://github.com/scummvm/scummvm/commit/76ac4414ec156882711321acaf61cf5d5e642dd9
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2021-02-08T03:09:58+02:00

Commit Message:
BASE: Fix crash when building with uncached plugins and static detection

Changed paths:
    base/plugins.cpp
    base/plugins.h


diff --git a/base/plugins.cpp b/base/plugins.cpp
index f0f4d6f028..184b80d4fd 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -344,12 +344,14 @@ void PluginManagerUncached::init() {
 
 	unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); // empty the engine plugins
 
+#ifndef DETECTION_STATIC
 	Common::String detectPluginName = "detection";
 #ifdef PLUGIN_SUFFIX
 	detectPluginName += PLUGIN_SUFFIX;
 #endif
 
 	bool foundDetectPlugin = false;
+#endif
 
 	for (ProviderList::iterator pp = _providers.begin();
 	                            pp != _providers.end();
@@ -361,6 +363,7 @@ void PluginManagerUncached::init() {
 			// file plugins. Currently this is the case. If it changes, we
 			// should find a fast way of detecting whether a plugin is a
 			// music or an engine plugin.
+#ifndef DETECTION_STATIC
 			if (!foundDetectPlugin && (*pp)->isFilePluginProvider()) {
 				Common::String pName = (*p)->getFileName();
 				if (pName.hasSuffix(detectPluginName)) {
@@ -370,6 +373,7 @@ void PluginManagerUncached::init() {
 					continue;
 				}
 			}
+#endif
 
 			if ((*pp)->isFilePluginProvider()) {
 				_allEnginePlugins.push_back(*p);
@@ -443,6 +447,7 @@ void PluginManagerUncached::updateConfigWithFileName(const Common::String &engin
 	}
 }
 
+#ifndef DETECTION_STATIC
 void PluginManagerUncached::loadDetectionPlugin() {
 	bool linkMetaEngines = false;
 
@@ -484,6 +489,7 @@ void PluginManagerUncached::unloadDetectionPlugin() {
 		debug(9, "Detection plugin is already unloaded.");
 	}
 }
+#endif
 
 void PluginManagerUncached::loadFirstPlugin() {
 	unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false);
diff --git a/base/plugins.h b/base/plugins.h
index fb6ed182ec..48780d8389 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -372,7 +372,7 @@ protected:
 
 	bool _isDetectionLoaded;
 
-	PluginManagerUncached() : _isDetectionLoaded(false) {}
+	PluginManagerUncached() : _isDetectionLoaded(false), _detectionPlugin(nullptr) {}
 	bool loadPluginByFileName(const Common::String &filename);
 
 public:
@@ -381,8 +381,10 @@ public:
 	virtual bool loadNextPlugin() override;
 	virtual bool loadPluginFromEngineId(const Common::String &engineId) override;
 	virtual void updateConfigWithFileName(const Common::String &engineId) override;
+#ifndef DETECTION_STATIC
 	virtual void loadDetectionPlugin() override;
 	virtual void unloadDetectionPlugin() override;
+#endif
 
 	virtual void loadAllPlugins() override {} 	// we don't allow these
 	virtual void loadAllPluginsOfType(PluginType type) override {}




More information about the Scummvm-git-logs mailing list