diff options
Diffstat (limited to 'src/gui/widgets/scrollarea.cpp')
-rw-r--r-- | src/gui/widgets/scrollarea.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 6d7695198..a260142a1 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -96,23 +96,19 @@ ScrollArea::~ScrollArea() delete getContent(); instances--; - const Theme *const theme = Theme::instance(); - if (theme) + if (instances == 0) { - if (instances == 0) + Theme::unloadRect(background); + Theme::unloadRect(vMarker); + Theme::unloadRect(vMarkerHi); + Theme::unloadRect(vBackground); + Theme::unloadRect(hBackground); + for (int i = 0; i < 2; i ++) { - theme->unloadRect(background); - theme->unloadRect(vMarker); - theme->unloadRect(vMarkerHi); - theme->unloadRect(vBackground); - theme->unloadRect(hBackground); - for (int i = 0; i < 2; i ++) + for (int f = UP; f < BUTTONS_DIR; f ++) { - for (int f = UP; f < BUTTONS_DIR; f ++) - { - if (buttons[f][i]) - buttons[f][i]->decRef(); - } + if (buttons[f][i]) + buttons[f][i]->decRef(); } } } |