From 261622733c9e30fee08a14623fa970020ead9436 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 20 Jan 2016 18:53:03 +0100 Subject: [PATCH] gtkdnd: Disconnect GdkDragContext signals on gtk_drag_source_info_free() Otherwise it may still be tricked into emitting further signals at a time we've already destroyed the GtkDragSourceInfo passed as callback user data. --- gtk/gtkdnd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 6c60fed6c7..b31b5c5336 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -3206,6 +3206,19 @@ gtk_drag_source_info_free (GtkDragSourceInfo *info) static void gtk_drag_source_info_destroy (GtkDragSourceInfo *info) { + g_signal_handlers_disconnect_by_func (info->context, + gtk_drag_context_drop_performed_cb, + info); + g_signal_handlers_disconnect_by_func (info->context, + gtk_drag_context_dnd_finished_cb, + info); + g_signal_handlers_disconnect_by_func (info->context, + gtk_drag_context_cancel_cb, + info); + g_signal_handlers_disconnect_by_func (info->context, + gtk_drag_context_action_cb, + info); + g_signal_handlers_disconnect_by_func (info->ipc_widget, gtk_drag_grab_broken_event_cb, info);