From: Marcel Holtmann Date: Fri, 26 Dec 2008 21:53:11 +0000 (+0100) Subject: Unlink node before calling remove callback X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~4322 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7efb49e571b228f9c4ef55449cf03ab0f7fdf638;p=profile%2Fivi%2Fconnman.git Unlink node before calling remove callback --- diff --git a/src/element.c b/src/element.c index a690046..fbc5cc9 100644 --- a/src/element.c +++ b/src/element.c @@ -1783,6 +1783,9 @@ static gboolean remove_element(GNode *node, gpointer user_data) if (element == root) return FALSE; + if (node != NULL) + g_node_unlink(node); + if (element->driver) { disable_element(element); @@ -1794,10 +1797,8 @@ static gboolean remove_element(GNode *node, gpointer user_data) __connman_element_unlock(element); } - if (node != NULL) { - g_node_unlink(node); + if (node != NULL) g_node_destroy(node); - } if (element->type == CONNMAN_ELEMENT_TYPE_CONNECTION) { if (__connman_element_count(NULL,