summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-16 02:22:35 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-16 02:22:35 +0300
commit64519c3ffb855c4b6ff6f428ba29173217327306 (patch)
tree681616f58f91d356301e2802d127ee78a79df87f /src
parentb293d99a34d21d137374e46386b8669907cb3c1d (diff)
downloadplus-64519c3ffb855c4b6ff6f428ba29173217327306.tar.gz
plus-64519c3ffb855c4b6ff6f428ba29173217327306.tar.bz2
plus-64519c3ffb855c4b6ff6f428ba29173217327306.tar.xz
plus-64519c3ffb855c4b6ff6f428ba29173217327306.zip
delete from cache background image if it unused.
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/desktop.cpp9
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