aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-03 18:37:13 +0000
committerFilippos Karapetis2010-01-03 18:37:13 +0000
commit1b6b4c5c085ea1e359dbfeef3aacc320dcdca536 (patch)
tree797329e1c65a2b88abae7e81768f06af1fb66f2f
parent7fa62cdd2bf1cc364f8459e56cf642310ae5b399 (diff)
downloadscummvm-rg350-1b6b4c5c085ea1e359dbfeef3aacc320dcdca536.tar.gz
scummvm-rg350-1b6b4c5c085ea1e359dbfeef3aacc320dcdca536.tar.bz2
scummvm-rg350-1b6b4c5c085ea1e359dbfeef3aacc320dcdca536.zip
Fixed memory leak (as reported by eriktorbjorn)
svn-id: r46938
-rw-r--r--engines/sci/gui/gui_gfx.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index 55d9dcedea..18d925e3cf 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -318,14 +318,14 @@ void SciGuiGfx::BitsFree(GuiMemoryHandle memoryHandle) {
}
void SciGuiGfx::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId) {
- SciGuiPicture *picture;
+ SciGuiPicture *picture = new SciGuiPicture(_resMan, this, _screen, _palette, pictureId);
- picture = new SciGuiPicture(_resMan, this, _screen, _palette, pictureId);
// do we add to a picture? if not -> clear screen with white
- if (!addToFlag) {
+ if (!addToFlag)
ClearScreen(_screen->_colorWhite);
- }
+
picture->draw(animationNr, mirroredFlag, addToFlag, paletteId);
+ delete picture;
}
// This one is the only one that updates screen!