aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/styleengine.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 540e9d06..62ba60d7 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -59,6 +59,14 @@ StyleEngine::StyleEngine (dw::core::Layout *layout) {
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);
+ if (n->style)
+ n->style->unref ();
+ if (n->wordStyle)
+ n->wordStyle->unref ();
+ if (n->backgroundStyle)
+ n->backgroundStyle->unref ();
delete stack;
delete doctree;
delete cssContext;