summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-18 01:34:45 +0000
committerDavid Robillard <d@drobilla.net>2014-01-18 01:34:45 +0000
commitc781c7a5cd0c124b61f38a45ab4564fce022a89b (patch)
tree53f43d928f78ab84435725f1ac31dbcf2ec97611 /src/server
parent06c34ee30b63d0cfd8c7ae77adc637f9da9a84dd (diff)
downloadingen-c781c7a5cd0c124b61f38a45ab4564fce022a89b.tar.gz
ingen-c781c7a5cd0c124b61f38a45ab4564fce022a89b.tar.bz2
ingen-c781c7a5cd0c124b61f38a45ab4564fce022a89b.zip
Call lv2_lib_descriptor separately for different bundle paths
(fix loading several dynamic plugins like Ingen at once). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5314 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server')
-rw-r--r--src/server/ingen_lv2.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index 8daf9b05..03ea7f72 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -814,11 +814,17 @@ const LV2_Lib_Descriptor*
lv2_lib_descriptor(const char* bundle_path,
const LV2_Feature*const* features)
{
- Lib* lib = new Lib(bundle_path);
- static LV2_Lib_Descriptor desc = {
- lib, sizeof(LV2_Lib_Descriptor), lib_cleanup, lib_get_plugin
- };
- return &desc;
+ static const uint32_t desc_size = sizeof(LV2_Lib_Descriptor);
+ Lib* lib = new Lib(bundle_path);
+
+ // FIXME: memory leak. I think the LV2_Lib_Descriptor API is botched :(
+ LV2_Lib_Descriptor* desc = (LV2_Lib_Descriptor*)malloc(desc_size);
+ desc->handle = lib;
+ desc->size = desc_size;
+ desc->cleanup = lib_cleanup;
+ desc->get_plugin = lib_get_plugin;
+
+ return desc;
}
} // extern "C"