diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-01-16 02:22:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-01-16 02:22:35 +0300 |
commit | 64519c3ffb855c4b6ff6f428ba29173217327306 (patch) | |
tree | 681616f58f91d356301e2802d127ee78a79df87f /src/gui/widgets/desktop.cpp | |
parent | b293d99a34d21d137374e46386b8669907cb3c1d (diff) | |
download | manaplus-64519c3ffb855c4b6ff6f428ba29173217327306.tar.gz manaplus-64519c3ffb855c4b6ff6f428ba29173217327306.tar.bz2 manaplus-64519c3ffb855c4b6ff6f428ba29173217327306.tar.xz manaplus-64519c3ffb855c4b6ff6f428ba29173217327306.zip |
delete from cache background image if it unused.
Diffstat (limited to 'src/gui/widgets/desktop.cpp')
-rw-r--r-- | src/gui/widgets/desktop.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index 8ccfcb982..2be86f615 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -159,9 +159,10 @@ void Desktop::setBestFittingWallpaper() if (nWallPaper) { + ResourceManager *const resman = ResourceManager::getInstance(); if (mWallpaper) { - mWallpaper->decRef(); + resman->moveToDeleted(mWallpaper); mWallpaper = nullptr; } @@ -174,13 +175,13 @@ void Desktop::setBestFittingWallpaper() || nWallPaper->getHeight() != height)) { // We rescale to obtain a fullscreen wallpaper... - Image *const newRsclWlPpr = ResourceManager::getInstance() - ->getRescaled(nWallPaper, width, height); + Image *const newRsclWlPpr = resman->getRescaled( + nWallPaper, width, height); if (newRsclWlPpr) { + resman->moveToDeleted(nWallPaper); // We replace the resource in the resource manager - nWallPaper->decRef(); mWallpaper = newRsclWlPpr; } else |