aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Puccinelli2010-08-06 06:54:44 +0000
committerTony Puccinelli2010-08-06 06:54:44 +0000
commit4bed67767cc4b8555a3d7169fcbb589ce0145303 (patch)
treed78c581f5367b4d27fed255c93df5a9166c601a2
parentd4a4176123f1a39916d1b407ab531bf3adb04697 (diff)
downloadscummvm-rg350-4bed67767cc4b8555a3d7169fcbb589ce0145303.tar.gz
scummvm-rg350-4bed67767cc4b8555a3d7169fcbb589ce0145303.tar.bz2
scummvm-rg350-4bed67767cc4b8555a3d7169fcbb589ce0145303.zip
added loadPlugin function into DSPlugin (doesn't use a DSDLObject yet)
svn-id: r51778
-rw-r--r--backends/plugins/ds/ds-provider.cpp25
-rw-r--r--backends/plugins/elf-provider.h2
2 files changed, 24 insertions, 3 deletions
diff --git a/backends/plugins/ds/ds-provider.cpp b/backends/plugins/ds/ds-provider.cpp
index e4ffb7bd43..999781754b 100644
--- a/backends/plugins/ds/ds-provider.cpp
+++ b/backends/plugins/ds/ds-provider.cpp
@@ -45,11 +45,32 @@ public:
unloadPlugin();
}
+ bool loadPlugin();
};
-/*bool DSPlugin::loadPlugin() {
+bool DSPlugin::loadPlugin() {
+ assert(!_dlHandle);
+ DLObject *obj = new DLObject(NULL);
+ if (obj->open(_filename.c_str())) {
+ _dlHandle = obj;
+ } else {
+ delete obj;
+ _dlHandle = NULL;
+ }
-};*/
+ if (!_dlHandle) {
+ warning("Failed loading plugin '%s'", _filename.c_str());
+ return false;
+ }
+
+ bool ret = DynamicPlugin::loadPlugin();
+
+ if (ret && _dlHandle) {
+ _dlHandle->discard_symtab();
+ }
+
+ return ret;
+};
Plugin* DSPluginProvider::createPlugin(const Common::FSNode &node) const {
return new DSPlugin(node.getPath());
diff --git a/backends/plugins/elf-provider.h b/backends/plugins/elf-provider.h
index 2e659df80c..eb0ea5d51d 100644
--- a/backends/plugins/elf-provider.h
+++ b/backends/plugins/elf-provider.h
@@ -53,7 +53,7 @@ public:
unloadPlugin();
}
- bool loadPlugin();
+ virtual bool loadPlugin();
virtual void unloadPlugin();
};