pidgin: 2b730bfa: GSList internally doesn't use the same a...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sat Aug 29 18:11:18 EDT 2009


-----------------------------------------------------------------
Revision: 2b730bfa4fd98d2ab0b35c3d3830a3383507ba8e
Ancestor: c27f8a083ba9a4b708bbccde2ac8b03a290610ec
Author: darkrain42 at pidgin.im
Date: 2009-08-29T22:04:20
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/2b730bfa4fd98d2ab0b35c3d3830a3383507ba8e

Modified files:
        pidgin/plugins/gestures/stroke.c

ChangeLog: 

GSList internally doesn't use the same allocator as gmalloc. Refs #400.

In particular, GSList in newer versions of GLib uses the slice allocator,
which is probably where this crash is coming from.

-------------- next part --------------
============================================================
--- pidgin/plugins/gestures/stroke.c	579c4b5c21df5b7cb9ff64368ecaec2e64141b64
+++ pidgin/plugins/gestures/stroke.c	3aeda3eb60290daa78b1c2b7a8facacb54c85ec1
@@ -207,10 +207,7 @@ _gstroke_record (gint x, gint y, struct 
       metrics->max_x = -1;
       metrics->max_y = -1;
 
-      metrics->pointList = (GSList*) g_malloc (sizeof (GSList));
-
-      metrics->pointList->data = new_point_p;
-      metrics->pointList->next = NULL;
+      metrics->pointList = g_slist_prepend(metrics->pointList, new_point_p);
       metrics->point_count = 0;
 
     } else {


More information about the Commits mailing list