[gtk+] widget: Avoid critical warnings when disconnecting plain GtkEventControllers



commit 4d524ab469425976fa9bbe5d03f75d6feb69a8a0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Nov 5 13:13:37 2015 +0100

    widget: Avoid critical warnings when disconnecting plain GtkEventControllers
    
    This signal is only set on GtkGesture objects, so check it's really there
    before disconnecting.

 gtk/gtkwidget.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index fe28d1a..78cfd5e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -17500,7 +17500,9 @@ _gtk_widget_remove_controller (GtkWidget          *widget,
   if (g_signal_handler_is_connected (widget, data->grab_notify_id))
     g_signal_handler_disconnect (widget, data->grab_notify_id);
 
-  g_signal_handler_disconnect (data->controller, data->sequence_state_changed_id);
+  if (data->sequence_state_changed_id)
+    g_signal_handler_disconnect (data->controller, data->sequence_state_changed_id);
+
   data->controller = NULL;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]