Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed|libappfw: Memory leak in LogWidget (at shutdown)
The cached entries were not deleted when the widget was deleted.
  • Loading branch information
skyjake committed Oct 30, 2014
1 parent 1bc1213 commit 82832a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doomsday/libappfw/src/widgets/logwidget.cpp
Expand Up @@ -382,6 +382,7 @@ public Font::RichFormat::IStyle
~Instance()
{
LogBuffer::get().removeSink(sink);
DENG2_ASSERT(cache.isEmpty());
}

void clear()
Expand All @@ -392,8 +393,8 @@ public Font::RichFormat::IStyle

void clearCache()
{
entryAtlas->clear();
cache.clear(); // Ongoing text wrapping cancelled automatically.
qDeleteAll(cache); // Ongoing text wrapping cancelled automatically.
cache.clear();
}

void updateStyle()
Expand Down Expand Up @@ -489,6 +490,7 @@ public Font::RichFormat::IStyle

delete entryAtlas;
entryAtlas = 0;
scrollTex = Id::None;

contents.clear();
background.clear();
Expand Down

0 comments on commit 82832a8

Please sign in to comment.