summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-03-15 19:58:46 +0000
committerDavid Robillard <d@drobilla.net>2011-03-15 19:58:46 +0000
commit91aa0bcb72b365392a9352d7e82e9dc6058b39a8 (patch)
treee7e7fead373a426e8507296f57d656304d68cbc1
parent4770234867a084ae21534a5f237efaaeb832c68c (diff)
downloadingen-91aa0bcb72b365392a9352d7e82e9dc6058b39a8.tar.gz
ingen-91aa0bcb72b365392a9352d7e82e9dc6058b39a8.tar.bz2
ingen-91aa0bcb72b365392a9352d7e82e9dc6058b39a8.zip
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
-rw-r--r--src/client/PluginUI.cpp14
1 files changed, 9 insertions, 5 deletions
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<PluginUI> 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<PluginUI>();
+ }
+
+ SharedPtr<PluginUI> 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 {