After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 552303 - leaks
leaks
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2008-09-15 02:01 UTC by Matthias Clasen
Modified: 2009-01-28 02:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
minimal patch (785 bytes, patch)
2008-09-15 02:44 UTC, Matthias Clasen
committed Details | Review

Description Matthias Clasen 2008-09-15 02:01:44 UTC
valgrind says:

==24302== 24 (8 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 2,964 of 5,681
==24302==    at 0x4006AEE: malloc (vg_replace_malloc.c:207)
==24302==    by 0xA88873: g_malloc (gmem.c:131)
==24302==    by 0xA9F3F2: g_slice_alloc (gslice.c:824)
==24302==    by 0xA9FEB1: g_slist_prepend (gslist.c:160)
==24302==    by 0x8066FAE: meta_display_compute_resistance_and_snapping_edges (edge-resistance.c:980)
==24302==    by 0x805FB01: meta_display_begin_grab_op (display.c:3449)


If you look at meta_display_compute_resistance_and_snapping_edges, it creates a list with head window_stacking, then reverses it with

  rem_win_stacking  = g_slist_reverse (window_stacking);

then later moves a bit into the list (loosing the head):

          while (rem_win_stacking &&
                 stack_position >= GPOINTER_TO_INT (rem_win_stacking->data))
            {
              rem_windows      = rem_windows->next;
              rem_win_stacking = rem_win_stacking->next;
            }

and at the end, tries to free it:

  g_slist_free (window_stacking);

but that ain't gonna work, since window stacking points at the last element of the reversed list now...

Same problem for the stacked_windows list.
Comment 1 Matthias Clasen 2008-09-15 02:44:26 UTC
Created attachment 118723 [details] [review]
minimal patch
Comment 2 Thomas Thurman 2009-01-28 02:31:07 UTC
Committed with thanks.
http://svn.gnome.org/viewvc/metacity?rev=4095&view=rev