From 2dcab6c3e55ef00d9e9424ea6e2aeea0c78c321b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 22 Aug 2011 17:23:18 +0000 Subject: Fix jalv.gtk when run with UI-less plugins. git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@3447 a436a847-0d15-0410-975c-d299462d15a1 --- src/jalv.c | 6 ++++-- src/jalv_gtk2.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/jalv.c b/src/jalv.c index 6a15063..c2cf3b8 100644 --- a/src/jalv.c +++ b/src/jalv.c @@ -574,8 +574,10 @@ main(int argc, char** argv) /* Clean up */ free(host.ports); - jack_ringbuffer_free(host.ui_events); - jack_ringbuffer_free(host.plugin_events); + if (host.ui) { + jack_ringbuffer_free(host.ui_events); + jack_ringbuffer_free(host.plugin_events); + } lilv_node_free(native_ui_type); lilv_node_free(host.input_class); lilv_node_free(host.output_class); diff --git a/src/jalv_gtk2.c b/src/jalv_gtk2.c index 6e4e9cd..d1a4a00 100644 --- a/src/jalv_gtk2.c +++ b/src/jalv_gtk2.c @@ -127,6 +127,9 @@ jalv_open_ui(Jalv* jalv, if (instance) { GtkWidget* widget = (GtkWidget*)suil_instance_get_widget(instance); gtk_container_add(GTK_CONTAINER(alignment), widget); + + g_timeout_add(1000 / JALV_UI_UPDATE_HZ, + (GSourceFunc)jalv_emit_ui_events, jalv); } else { GtkWidget* button = gtk_button_new_with_label("Close"); @@ -143,9 +146,6 @@ jalv_open_ui(Jalv* jalv, gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show_all(window); - g_timeout_add(1000 / JALV_UI_UPDATE_HZ, - (GSourceFunc)jalv_emit_ui_events, jalv); - gtk_main(); sem_post(jalv->done); return 0; -- cgit v1.2.1