aboutsummaryrefslogtreecommitdiff
path: root/src/styleengine.cc
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-10-17 21:41:31 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-10-17 21:41:31 +0200
commit6c7f9bd1398482e9098c8495dc2c5f13e771a865 (patch)
tree6caba1be99b927c1a6b93f09004d9a7bf44c18d4 /src/styleengine.cc
parent9a737b2257fe22826095ea02c4db49f86447c0d1 (diff)
fix another Style leak in StyleEngine
Diffstat (limited to 'src/styleengine.cc')
-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;