summaryrefslogtreecommitdiff
path: root/libs/ardour/panner_manager.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-07-11 13:58:48 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-07-11 13:58:48 -0400
commit83ed3d7dcc121bb7947d7532c869ccf3e0510b86 (patch)
tree66adb4caa8b58b90d638b1086c53b0ac785e8534 /libs/ardour/panner_manager.cc
parent058ebf98b928f735ac2dbd5026a4dcf3fba3e67b (diff)
Use glibmm for modules instead of dlfch.h
Diffstat (limited to 'libs/ardour/panner_manager.cc')
-rw-r--r--libs/ardour/panner_manager.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/libs/ardour/panner_manager.cc b/libs/ardour/panner_manager.cc
index c3601d41de..e77104dd33 100644
--- a/libs/ardour/panner_manager.cc
+++ b/libs/ardour/panner_manager.cc
@@ -106,31 +106,33 @@ PannerManager::panner_discover (string path)
PannerInfo*
PannerManager::get_descriptor (string path)
{
- void *module;
+ Glib::Module* module = new Glib::Module(path);
PannerInfo* info = 0;
PanPluginDescriptor *descriptor = 0;
PanPluginDescriptor* (*dfunc)(void);
- const char *errstr;
+ void* func = 0;
- if ((module = dlopen (path.c_str(), RTLD_NOW)) == 0) {
- error << string_compose(_("PannerManager: cannot load module \"%1\" (%2)"), path, dlerror()) << endmsg;
+ if (!module) {
+ error << string_compose(_("PannerManager: cannot load module \"%1\" (%2)"), path,
+ Glib::Module::get_last_error()) << endmsg;
+ delete module;
return 0;
}
- dfunc = (PanPluginDescriptor* (*)(void)) dlsym (module, "panner_descriptor");
-
- if ((errstr = dlerror()) != 0) {
+ if (!module->get_symbol("panner_descriptor", func)) {
error << string_compose(_("PannerManager: module \"%1\" has no descriptor function."), path) << endmsg;
- error << errstr << endmsg;
- dlclose (module);
+ error << Glib::Module::get_last_error() << endmsg;
+ delete module;
return 0;
}
+ dfunc = (PanPluginDescriptor* (*)(void))func;
descriptor = dfunc();
+
if (descriptor) {
info = new PannerInfo (*descriptor, module);
} else {
- dlclose (module);
+ delete module;
}
return info;