diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-06-29 23:52:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-06-30 00:10:21 +0300 |
commit | 63bed529c78ca05d3e32a0b6ec3bcfd6152e53de (patch) | |
tree | 9d233f3ecf71452123f45b4563fef8be4308769b /src/gui/widgets/desktop.cpp | |
parent | 27300ff284bbed3b6bce938071c3982e4a757680 (diff) | |
download | manaverse-63bed529c78ca05d3e32a0b6ec3bcfd6152e53de.tar.gz manaverse-63bed529c78ca05d3e32a0b6ec3bcfd6152e53de.tar.bz2 manaverse-63bed529c78ca05d3e32a0b6ec3bcfd6152e53de.tar.xz manaverse-63bed529c78ca05d3e32a0b6ec3bcfd6152e53de.zip |
Fix memory leak in desktop.cpp
Diffstat (limited to 'src/gui/widgets/desktop.cpp')
-rw-r--r-- | src/gui/widgets/desktop.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index f7183553f..6ba6477d6 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -38,8 +38,8 @@ #include "debug.h" -Desktop::Desktop() - : mWallpaper(0) +Desktop::Desktop() : + mWallpaper(0) { addWidgetListener(this); @@ -132,23 +132,15 @@ void Desktop::setBestFittingWallpaper() || nWallPaper->getHeight() != getHeight())) { // We rescale to obtain a fullscreen wallpaper... - Image *newRsclWlPpr = nWallPaper->SDLgetScaledImage( - getWidth(), getHeight()); - std::string idPath = nWallPaper->getIdPath(); + Image *newRsclWlPpr = ResourceManager::getInstance()->getRescaled( + nWallPaper, getWidth(), getHeight()); // We replace the resource in the resource manager nWallPaper->decRef(); if (newRsclWlPpr) - { - ResourceManager::getInstance()->addResource( - idPath, newRsclWlPpr); - mWallpaper = newRsclWlPpr; - } else - { mWallpaper = nWallPaper; - } } else { |