changeset 1749:1a3af54d6003

fix another Style leak in StyleEngine
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Sun, 17 Oct 2010 21:41:31 +0200
parents ad210fc5a366
children 5b5ef1888a47
files src/styleengine.cc
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/styleengine.cc	Sun Oct 17 21:03:49 2010 +0200
+++ b/src/styleengine.cc	Sun Oct 17 21:41:31 2010 +0200
@@ -59,6 +59,14 @@
 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;