aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/jalv.c6
-rw-r--r--src/jalv_gtk2.c6
2 files changed, 7 insertions, 5 deletions
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;