fepitre / rpms / gtk3

Forked from rpms/gtk3 4 years ago
Clone
Blob Blame History Raw
From ad6a66ba07be05b7fac30417bde83015fd216e43 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Mon, 6 Jul 2015 19:33:49 +0200
Subject: [PATCH] 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
---
 gtk/gtkdnd.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index c8a190c..364c382 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -3258,10 +3258,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
-- 
2.4.5