summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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