aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2012-11-03 17:23:19 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2012-11-03 17:23:19 +0100
commit8cd9ac98b1bb5a1df3d0084ae238f65261d357df (patch)
tree2ba1db4fb7b011002896b16a34dd7ea10eabeb98
parentd5ea1712e545613088a6b468e84019cc54529b7a (diff)
more stylengine cleanups
-rw-r--r--src/styleengine.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 7c43e92f..f6043179 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -64,13 +64,18 @@ StyleEngine::~StyleEngine () {
while (doctree->top ())
endElement (doctree->top ()->element);
assert (stack->size () == 1); // dummy node on the bottom of the stack
+
Node *n = stack->getRef (stack->size () - 1);
+ delete n->styleAttrProperties;
+ delete n->styleAttrPropertiesImportant;
+ delete n->nonCssProperties;
if (n->style)
n->style->unref ();
if (n->wordStyle)
n->wordStyle->unref ();
if (n->backgroundStyle)
n->backgroundStyle->unref ();
+
delete stack;
delete doctree;
delete cssContext;
@@ -218,12 +223,9 @@ void StyleEngine::endElement (int element) {
Node *n = stack->getRef (stack->size () - 1);
- if (n->styleAttrProperties)
- delete n->styleAttrProperties;
- if (n->styleAttrPropertiesImportant)
- delete n->styleAttrPropertiesImportant;
- if (n->nonCssProperties)
- delete n->nonCssProperties;
+ delete n->styleAttrProperties;
+ delete n->styleAttrPropertiesImportant;
+ delete n->nonCssProperties;
if (n->style)
n->style->unref ();
if (n->wordStyle)