[gtk+] GtkIconView: fix a memory corruption in the drag-n-drop code



commit f9c24e8f0379c7bbeda1793742f7ef752472412c
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Thu Dec 1 22:47:36 2011 +0100

    GtkIconView: fix a memory corruption in the drag-n-drop code
    
    You shall free with g_slice_free() what you allocate with
    g_slice_new().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=665338

 gtk/gtkiconview.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index e12bd46..67141ec 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -6133,6 +6133,11 @@ drag_scroll_timeout (gpointer datap)
   return TRUE;
 }
 
+static void
+drag_scroll_data_free (DragScrollData *data)
+{
+  g_slice_free (DragScrollData, data);
+}
 
 static gboolean
 set_destination (GtkIconView    *icon_view,
@@ -6530,7 +6535,7 @@ gtk_icon_view_drag_motion (GtkWidget      *widget,
           data->device = gdk_drag_context_get_device (context);
 
 	  icon_view->priv->scroll_timeout_id =
-	    gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 50, drag_scroll_timeout, data, g_free);
+	    gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 50, drag_scroll_timeout, data, (GDestroyNotify) drag_scroll_data_free);
 	}
 
       if (target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))



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