aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-11 03:04:28 +0000
committerDavid Robillard <d@drobilla.net>2012-04-11 03:04:28 +0000
commit454f7c8b0ac63c1291fba5445d870773d0c980d3 (patch)
treea34f6e16afb20aa92e00a34cabeca9dfb1111b78
parent6e771526106e8e1635b462064ad375ecda0b177a (diff)
downloadjalv-454f7c8b0ac63c1291fba5445d870773d0c980d3.tar.gz
jalv-454f7c8b0ac63c1291fba5445d870773d0c980d3.tar.bz2
jalv-454f7c8b0ac63c1291fba5445d870773d0c980d3.zip
Fix memory leak.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@4159 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/jalv.c7
-rw-r--r--src/jalv_internal.h1
2 files changed, 5 insertions, 3 deletions
diff --git a/src/jalv.c b/src/jalv.c
index fbbd95e..042f7bc 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -770,9 +770,9 @@ main(int argc, char** argv)
const LilvNode* ui_type = NULL;
host.ui = NULL;
if (native_ui_type) {
- LilvUIs* uis = lilv_plugin_get_uis(host.plugin); // FIXME: leak
- LILV_FOREACH(uis, u, uis) {
- const LilvUI* this_ui = lilv_uis_get(uis, u);
+ host.uis = lilv_plugin_get_uis(host.plugin);
+ LILV_FOREACH(uis, u, host.uis) {
+ const LilvUI* this_ui = lilv_uis_get(host.uis, u);
if (lilv_ui_is_supported(
this_ui, suil_ui_supported, native_ui_type, &ui_type)) {
// TODO: Multiple UI support
@@ -959,6 +959,7 @@ main(int argc, char** argv)
symap_free(host.symap);
suil_host_free(ui_host);
sratom_free(host.sratom);
+ lilv_uis_free(host.uis);
lilv_world_free(world);
zix_sem_destroy(&exit_sem);
diff --git a/src/jalv_internal.h b/src/jalv_internal.h
index 50587a6..737abf0 100644
--- a/src/jalv_internal.h
+++ b/src/jalv_internal.h
@@ -157,6 +157,7 @@ typedef struct {
char* temp_dir; ///< Temporary plugin state directory
char* save_dir; ///< Plugin save directory
const LilvPlugin* plugin; ///< Plugin class (RDF data)
+ LilvUIs* uis; ///< All plugin UIs (RDF data)
const LilvUI* ui; ///< Plugin UI (RDF data)
LilvInstance* instance; ///< Plugin instance (shared library)
SuilInstance* ui_instance; ///< Plugin UI instance (shared library)