From: Carlos Garnacho Date: Mon, 6 Jul 2015 17:33:49 +0000 (+0200) Subject: gtkdnd: Account for setting a same icon helper X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~24^2~9111 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=dadb2750b1ff288c5627f472faf94b33b1f355bb;p=gtk4.git gtkdnd: Account for setting a same icon helper g_set_object() will take care of ref'ing before destroying the previous instance, which might actually be the same pointer. https://bugzilla.gnome.org/show_bug.cgi?id=751401 --- diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 732d237231..399e319e58 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -3141,10 +3141,7 @@ set_icon_helper (GdkDragContext *context, info = gtk_drag_get_source_info (context, FALSE); - if (info->icon_helper) - g_object_unref (info->icon_helper); - info->icon_helper = g_object_ref (helper); - + g_set_object (&info->icon_helper, helper); gtk_drag_set_icon_window (context, NULL, hot_x, hot_y, TRUE); } else