From 14a9a1da30ca772efd42a9ce6662a11b102818bc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 12 Jul 2012 11:01:25 +0300 Subject: Fix leaks after last commit. --- src/gui/widgets/scrollarea.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gui/widgets/scrollarea.cpp') diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 4e15bc167..4cc4cad41 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -92,6 +92,21 @@ ScrollArea::~ScrollArea() delete getContent(); instances--; + if (instances == 0 && Theme::instance()) + { + Theme *theme = Theme::instance(); + theme->unloadRect(background); + theme->unloadRect(vMarker); + theme->unloadRect(vMarkerHi); + for (int i = 0; i < 2; i ++) + { + for (int f = UP; f < BUTTONS_DIR; f ++) + { + if (buttons[f][i]) + buttons[f][i]->decRef(); + } + } + } delete mVertexes; mVertexes = nullptr; -- cgit v1.2.3-70-g09d2