mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-20 17:03:05 +00:00
Fix plugin unloading / cleanup
svn-id: r30785
This commit is contained in:
parent
afa731b0af
commit
dd7fcd6867
@ -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());
|
||||
|
@ -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
|
||||
|
@ -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());
|
||||
|
@ -70,6 +70,7 @@ public:
|
||||
return DynamicPlugin::loadPlugin();
|
||||
}
|
||||
void unloadPlugin() {
|
||||
DynamicPlugin::unloadPlugin();
|
||||
if (_dlHandle) {
|
||||
SDL_UnloadObject(_dlHandle);
|
||||
_dlHandle = 0;
|
||||
|
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user