Author: jannis
Date: 2008-07-17 19:31:41 +0000 (Thu, 17 Jul 2008)
New Revision: 27332
Modified:
xfconf/trunk/xfconfd/xfconf-backend-perchannel-xml.c
Log:
xfconfd/xfconf-backend-perchannel-xml.c: Fix crash when removing the
last property of a channel. The check whether we are at the root node
(the one with prop->name == "/") was done after accessing the parent
of the current node (which is NULL for the root node).
Modified: xfconf/trunk/xfconfd/xfconf-backend-perchannel-xml.c
===================================================================
--- xfconf/trunk/xfconfd/xfconf-backend-perchannel-xml.c 2008-07-17
18:19:09 UTC (rev 27331)
+++ xfconf/trunk/xfconfd/xfconf-backend-perchannel-xml.c 2008-07-17
19:31:41 UTC (rev 27332)
@@ -712,11 +712,11 @@
g_node_unlink(node);
xfconf_proptree_destroy(node);
- /* remove parents without values until we find a parent with
- * a value or any children */
+ /* remove parents without values until we find the root node
or
+ * a parent with a value or any children */
while(parent) {
prop = parent->data;
- if(!G_IS_VALUE(&prop->value) && !parent->children) {
+ if(!G_IS_VALUE(&prop->value) && !parent->children &&
strcmp(prop->name, "/") != 0) {
GNode *tmp = parent;
parent = parent->parent;
@@ -724,11 +724,6 @@
g_node_unlink(tmp);
xfconf_proptree_destroy(tmp);
-
- /* but don't remove the root node */
- prop = parent->data;
- if(!strcmp("/", prop->name))
- parent = NULL;
} else
parent = NULL;
}
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits