diff options
author | Tomas Popela <tpopela@redhat.com> | 2014-08-17 15:03:13 +0800 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2014-08-17 15:03:13 +0800 |
commit | 0d437729dfb2314a82f3953cfc1c4983ca6646a3 (patch) | |
tree | 6793cfd1d7316655dc6f32013ba622082cb4ebf8 /e-util/e-web-view.c | |
parent | e3849d0f090cc292b5ff4282d694854f20369906 (diff) | |
download | gsoc2013-evolution-0d437729dfb2314a82f3953cfc1c4983ca6646a3.tar gsoc2013-evolution-0d437729dfb2314a82f3953cfc1c4983ca6646a3.tar.gz gsoc2013-evolution-0d437729dfb2314a82f3953cfc1c4983ca6646a3.tar.bz2 gsoc2013-evolution-0d437729dfb2314a82f3953cfc1c4983ca6646a3.tar.lz gsoc2013-evolution-0d437729dfb2314a82f3953cfc1c4983ca6646a3.tar.xz gsoc2013-evolution-0d437729dfb2314a82f3953cfc1c4983ca6646a3.tar.zst gsoc2013-evolution-0d437729dfb2314a82f3953cfc1c4983ca6646a3.zip |
EWebView - If the parent of the node that we want to remove doesn't exist, just free it
Diffstat (limited to 'e-util/e-web-view.c')
-rw-r--r-- | e-util/e-web-view.c | 11 |
1 files 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 |