diff options
author | David Robillard <d@drobilla.net> | 2011-03-15 01:42:54 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-03-15 01:42:54 +0000 |
commit | 6b289101e425d58c085a4c905bbcd6da211818a8 (patch) | |
tree | 4fa42a14a96a05b17283a0c8da0343c5bc6c134b /src | |
parent | 474190b330ce48bb0b3b1ea975d1cbd03dcff28c (diff) | |
download | lilv-6b289101e425d58c085a4c905bbcd6da211818a8.tar.gz lilv-6b289101e425d58c085a4c905bbcd6da211818a8.tar.bz2 lilv-6b289101e425d58c085a4c905bbcd6da211818a8.zip |
Fix dynamic manifest error handling.
Close dynamic manifest libraries after discovery.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@3084 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/world.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/world.c b/src/world.c index df97e7a..9983ded 100644 --- a/src/world.c +++ b/src/world.c @@ -395,15 +395,21 @@ slv2_world_load_bundle(SLV2World world, SLV2Value bundle_uri) // Open dynamic manifest typedef int (*OpenFunc)(LV2_Dyn_Manifest_Handle*, const LV2_Feature *const *); OpenFunc open_func = (OpenFunc)slv2_dlfunc(lib, "lv2_dyn_manifest_open"); - if (open_func) - open_func(&handle, &dman_features); + if (!open_func || open_func(&handle, &dman_features)) { + SLV2_ERRORF("Missing lv2_dyn_manifest_open in `%s'\n", lib_path); + dlclose(lib); + continue; + } // Get subjects (the data that would be in manifest.ttl) typedef int (*GetSubjectsFunc)(LV2_Dyn_Manifest_Handle, FILE*); - GetSubjectsFunc get_subjects_func = (GetSubjectsFunc)slv2_dlfunc(lib, - "lv2_dyn_manifest_get_subjects"); - if (!get_subjects_func) + GetSubjectsFunc get_subjects_func = (GetSubjectsFunc)slv2_dlfunc( + lib, "lv2_dyn_manifest_get_subjects"); + if (!get_subjects_func) { + SLV2_ERRORF("Missing lv2_dyn_manifest_get_subjects in `%s'\n", lib_path); + dlclose(lib); continue; + } // Generate data file FILE* fd = tmpfile(); @@ -430,6 +436,8 @@ slv2_world_load_bundle(SLV2World world, SLV2Value bundle_uri) &manifest_uri, binary, bundle_node); } slv2_match_end(plug_results); + + dlclose(lib); } slv2_match_end(dmanifests); #endif // SLV2_DYN_MANIFEST |