diff options
-rw-r--r-- | backends/plugins/dc/dc-provider.cpp | 1 | ||||
-rw-r--r-- | backends/plugins/dynamic-plugin.h | 9 | ||||
-rw-r--r-- | backends/plugins/posix/posix-provider.cpp | 1 | ||||
-rw-r--r-- | backends/plugins/sdl/sdl-provider.cpp | 1 | ||||
-rw-r--r-- | backends/plugins/win32/win32-provider.cpp | 1 |
5 files changed, 8 insertions, 5 deletions
diff --git a/backends/plugins/dc/dc-provider.cpp b/backends/plugins/dc/dc-provider.cpp index 32bfd64032..6ca524150b 100644 --- a/backends/plugins/dc/dc-provider.cpp +++ b/backends/plugins/dc/dc-provider.cpp @@ -76,6 +76,7 @@ public: return ret; } void unloadPlugin() { + DynamicPlugin::unloadPlugin(); if (_dlHandle) { if (dlclose(_dlHandle) != 0) warning("Failed unloading plugin '%s' (%s)", _filename.c_str(), dlerror()); diff --git a/backends/plugins/dynamic-plugin.h b/backends/plugins/dynamic-plugin.h index 79f436f172..2cf92ce602 100644 --- a/backends/plugins/dynamic-plugin.h +++ b/backends/plugins/dynamic-plugin.h @@ -42,11 +42,6 @@ protected: public: DynamicPlugin() : _metaengine(0) {} - ~DynamicPlugin() { - // FIXME: The plugin has already been unloaded, so _metaengine isn't - // a valid pointer anymore, and you can't call unloadPlugin from here. - //delete _metaengine; - } const char *getName() const { return _metaengine->getName(); @@ -88,6 +83,10 @@ public: return true; } + + virtual void unloadPlugin() { + delete _metaengine; + } }; #endif diff --git a/backends/plugins/posix/posix-provider.cpp b/backends/plugins/posix/posix-provider.cpp index 5d800df451..a268aa36e1 100644 --- a/backends/plugins/posix/posix-provider.cpp +++ b/backends/plugins/posix/posix-provider.cpp @@ -69,6 +69,7 @@ public: return DynamicPlugin::loadPlugin(); } void unloadPlugin() { + DynamicPlugin::unloadPlugin(); if (_dlHandle) { if (dlclose(_dlHandle) != 0) warning("Failed unloading plugin '%s' (%s)", _filename.c_str(), dlerror()); diff --git a/backends/plugins/sdl/sdl-provider.cpp b/backends/plugins/sdl/sdl-provider.cpp index 70dad313a1..5cdc7223a5 100644 --- a/backends/plugins/sdl/sdl-provider.cpp +++ b/backends/plugins/sdl/sdl-provider.cpp @@ -70,6 +70,7 @@ public: return DynamicPlugin::loadPlugin(); } void unloadPlugin() { + DynamicPlugin::unloadPlugin(); if (_dlHandle) { SDL_UnloadObject(_dlHandle); _dlHandle = 0; diff --git a/backends/plugins/win32/win32-provider.cpp b/backends/plugins/win32/win32-provider.cpp index e77cadd707..8cb9a762b2 100644 --- a/backends/plugins/win32/win32-provider.cpp +++ b/backends/plugins/win32/win32-provider.cpp @@ -95,6 +95,7 @@ public: return DynamicPlugin::loadPlugin(); } void unloadPlugin() { + DynamicPlugin::unloadPlugin(); if (_dlHandle) { if (!FreeLibrary((HMODULE)_dlHandle)) debug("Failed unloading plugin '%s'", _filename.c_str()); |