diff options
Diffstat (limited to 'src/world.c')
-rw-r--r-- | src/world.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/world.c b/src/world.c index 0d9c5e3..29c16d0 100644 --- a/src/world.c +++ b/src/world.c @@ -178,6 +178,7 @@ lilv_world_free(LilvWorld* world) sord_world_free(world->world); world->world = NULL; + free(world->opt.lv2_path); free(world); } @@ -196,6 +197,11 @@ lilv_world_set_option(LilvWorld* world, world->opt.filter_language = lilv_node_as_bool(value); return; } + } else if (!strcmp(uri, LILV_OPTION_LV2_PATH)) { + if (lilv_node_is_string(value)) { + world->opt.lv2_path = lilv_strdup(lilv_node_as_string(value)); + return; + } } LILV_WARNF("Unrecognized or invalid option `%s'\n", uri); } @@ -1031,7 +1037,10 @@ lilv_world_load_plugin_classes(LilvWorld* world) LILV_API void lilv_world_load_all(LilvWorld* world) { - const char* lv2_path = getenv("LV2_PATH"); + const char* lv2_path = world->opt.lv2_path; + if (!lv2_path) { + lv2_path = getenv("LV2_PATH"); + } if (!lv2_path) { lv2_path = LILV_DEFAULT_LV2_PATH; } |