aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2010-11-25 12:01:49 +0000
committerRobert Bragg <robert@linux.intel.com>2010-12-09 22:46:48 +0000
commit43c8ac7890bebf37b3660e519871c348b96520e3 (patch)
treea4b2a1401e7dfbd00ae5fd8fe1b600ec29a055a3
parentbf22db7f5da05e074c2531bf7e75d74ea246d46d (diff)
downloadlibmatchboxwm2-43c8ac7890bebf37b3660e519871c348b96520e3.tar.gz
libmatchboxwm2-43c8ac7890bebf37b3660e519871c348b96520e3.tar.bz2
libmatchboxwm2-43c8ac7890bebf37b3660e519871c348b96520e3.zip
theme: fix manual list manipulation
This is fallout from converting from the custom list implementation to GList. In xml_stack_pop we were using free() instead of g_list_free_1 to free a list node but also we were leaving the prev member of the new top in an inconsistent (non-NULL) state which was confusing the GList implementation resulting in a crash. We now use g_list_delete_link to remove the top of the list.
-rw-r--r--matchbox/mb-wm-theme.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/matchbox/mb-wm-theme.c b/matchbox/mb-wm-theme.c
index e610236..7282e16 100644
--- a/matchbox/mb-wm-theme.c
+++ b/matchbox/mb-wm-theme.c
@@ -827,11 +827,9 @@ static void
xml_stack_pop (GList ** stack)
{
GList * top = *stack;
- struct stack_data * s = top->data;
- *stack = top->next;
- free (s);
- free (top);
+ free (top->data);
+ *stack = g_list_delete_link (*stack, *stack);
}
static void