From 91aa0bcb72b365392a9352d7e82e9dc6058b39a8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 15 Mar 2011 19:58:46 +0000 Subject: Fix crash when double clicking nodes without custom UIs. Fix LV2 UI memory errors. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3093 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/PluginUI.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/client') diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index 3005a02a..cf6f503c 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -126,14 +126,20 @@ PluginUI::create(Ingen::Shared::World* world, PluginUI::ui_host = slv2_ui_host_new(lv2_ui_write, NULL, NULL, NULL); } - SharedPtr ret(new PluginUI(world, node)); - ret->_features = world->lv2_features()->lv2_features(world, node.get()); - SLV2Value gtk_ui = slv2_value_new_uri( world->slv2_world(), "http://lv2plug.in/ns/extensions/ui#GtkUI"); SLV2UI ui = slv2_plugin_get_default_ui(plugin, gtk_ui); + slv2_value_free(gtk_ui); + + if (!ui) { + return SharedPtr(); + } + + SharedPtr ret(new PluginUI(world, node)); + ret->_features = world->lv2_features()->lv2_features(world, node.get()); + SLV2UIInstance instance = slv2_ui_instance_new( plugin, ui, @@ -142,8 +148,6 @@ PluginUI::create(Ingen::Shared::World* world, ret.get(), ret->_features->array()); - slv2_ui_host_free(ui_host); - if (instance) { ret->_instance = instance; } else { -- cgit v1.2.1