GNOME Bugzilla – Bug 552303
leaks
Last modified: 2009-01-28 02:31:07 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.
Created attachment 118723 [details] [review] minimal patch
Committed with thanks. http://svn.gnome.org/viewvc/metacity?rev=4095&view=rev