widget: Avoid critical warnings when disconnecting plain GtkEventControllers

This signal is only set on GtkGesture objects, so check it's really there
before disconnecting.
This commit is contained in:
Carlos Garnacho 2015-11-05 13:13:37 +01:00
parent 66d2c9e6fa
commit 4d524ab469

View File

@ -17500,7 +17500,9 @@ _gtk_widget_remove_controller (GtkWidget *widget,
if (g_signal_handler_is_connected (widget, data->grab_notify_id)) if (g_signal_handler_is_connected (widget, data->grab_notify_id))
g_signal_handler_disconnect (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; data->controller = NULL;
} }