Fixed memory leak (as reported by eriktorbjorn)

svn-id: r46938
This commit is contained in:
Filippos Karapetis
2010-01-03 18:37:13 +00:00
parent 7fa62cdd2b
commit 1b6b4c5c08
+4 -4
View File
@@ -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!