From 0d437729dfb2314a82f3953cfc1c4983ca6646a3 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Sun, 17 Aug 2014 09:03:13 +0200 Subject: EWebView - If the parent of the node that we want to remove doesn't exist, just free it --- e-util/e-web-view.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/e-util/e-web-view.c b/e-util/e-web-view.c index 8a3b9c794b..df89e8de71 100644 --- a/e-util/e-web-view.c +++ b/e-util/e-web-view.c @@ -3529,8 +3529,15 @@ element_remove_class (WebKitDOMElement *element, void remove_node (WebKitDOMNode *node) { - webkit_dom_node_remove_child ( - webkit_dom_node_get_parent_node (node), node, NULL); + WebKitDOMNode *parent = webkit_dom_node_get_parent_node (node); + + /* Check if the parent exists, if so it means that the node is still + * in the DOM or at least the parent is. If it doesn't exists it is not + * in the DOM and we can free it. */ + if (parent) + webkit_dom_node_remove_child (parent, node, NULL); + else + g_object_unref (node); } void -- cgit v1.2.3