diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-02-15 17:42:22 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-02-15 17:42:22 +0100 |
commit | 94e60efe49d2d549a27a680a95d79d6c3c9ce3b6 (patch) | |
tree | 618ee40d73a03456e611d0c5c50e1f7e68b3095c /src | |
parent | 21ab6086012d25b3093b5da4407b9c8708ff416b (diff) |
clean StyleEngine::stack on deletion
Diffstat (limited to 'src')
-rw-r--r-- | src/styleengine.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc index 81054a06..28effb92 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -43,13 +43,17 @@ StyleEngine::StyleEngine (dw::core::Layout *layout) { n->num = num++; n->style = Style::create (layout, &style_attrs); n->wordStyle = NULL; + n->element = 0; + n->id = NULL; + n->klass = NULL; n->pseudo = NULL; n->styleAttribute = NULL; n->inheritBackgroundColor = false; } StyleEngine::~StyleEngine () { - /* \todo clear stack if not empty */ + while (stack->size () > 0) + endElement (stack->getRef (stack->size () - 1)->element); delete stack; delete cssContext; } @@ -136,7 +140,7 @@ void StyleEngine::setPseudoVisited () { */ void StyleEngine::endElement (int element) { // fprintf(stderr, "===> END %d\n", element); - assert (stack->size () > 1); + assert (stack->size () > 0); assert (element == stack->getRef (stack->size () - 1)->element); Node *n = stack->getRef (stack->size () - 1); |