From c1cf4a0aaa5742441eb3b0052844e9b3415a641b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 21 Apr 2013 21:37:37 +0000 Subject: Correctly remove Gtk timeout callback (fix #901). git-svn-id: http://svn.drobilla.net/lad/trunk/suil@5105 a436a847-0d15-0410-975c-d299462d15a1 --- src/x11_in_gtk2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/x11_in_gtk2.c b/src/x11_in_gtk2.c index 13986ce..e2d9cea 100644 --- a/src/x11_in_gtk2.c +++ b/src/x11_in_gtk2.c @@ -34,6 +34,7 @@ struct _SuilX11Wrapper { SuilInstance* instance; #ifdef HAVE_LV2_1_4_1 const LV2UI_Idle_Interface* idle_iface; + guint idle_id; #endif }; @@ -51,7 +52,10 @@ on_plug_removed(GtkSocket* sock, gpointer data) SuilX11Wrapper* const self = SUIL_X11_WRAPPER(sock); #ifdef HAVE_LV2_1_4_1 - g_idle_remove_by_data(self); + if (self->idle_id) { + g_source_remove(self->idle_id); + self->idle_id = 0; + } #endif if (self->instance->handle) { @@ -197,7 +201,7 @@ wrapper_wrap(SuilWrapper* wrapper, instance, LV2_UI__idleInterface); if (idle_iface) { wrap->idle_iface = idle_iface; - g_timeout_add(1000/30, suil_x11_wrapper_idle, wrap); // 30 Hz + wrap->idle_id = g_timeout_add(1000/30, suil_x11_wrapper_idle, wrap); } #endif -- cgit v1.2.1