aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/graphics.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2007-08-07 14:53:58 +0000
committerNicola Mettifogo2007-08-07 14:53:58 +0000
commitd30c3650a358e4e5ba8a548d4e218d7b49fba34a (patch)
treed0ad1727c50257b815cafe8cdeff69d55cb0f106 /engines/parallaction/graphics.cpp
parent66c0a57248d873f744ae928d28a7161fcf1d68f0 (diff)
downloadscummvm-rg350-d30c3650a358e4e5ba8a548d4e218d7b49fba34a.tar.gz
scummvm-rg350-d30c3650a358e4e5ba8a548d4e218d7b49fba34a.tar.bz2
scummvm-rg350-d30c3650a358e4e5ba8a548d4e218d7b49fba34a.zip
MaskBuffer and PathBuffer are now correctly freed before they are deallocated, and so is background Surface.
svn-id: r28483
Diffstat (limited to 'engines/parallaction/graphics.cpp')
-rw-r--r--engines/parallaction/graphics.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index e948fa7f26..5c31c87d7a 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -772,16 +772,20 @@ void Gfx::freeStaticCnv(StaticCnv *cnv) {
void Gfx::setBackground(Graphics::Surface *surface) {
- if (_buffers[kBit2])
+ if (_buffers[kBit2]) {
+ _buffers[kBit2]->free();
delete _buffers[kBit2];
+ }
_buffers[kBit2] = surface;
copyScreen(kBit2, kBitBack);
}
void Gfx::setMask(MaskBuffer *buffer) {
- if (_depthMask)
+ if (_depthMask) {
+ _depthMask->free();
delete _depthMask;
+ }
_depthMask = buffer;
}
@@ -893,16 +897,20 @@ Gfx::Gfx(Parallaction* vm) :
Gfx::~Gfx() {
- _depthMask->free();
- delete _depthMask;
+ if (_depthMask) {
+ _depthMask->free();
+ delete _depthMask;
+ }
_buffers[kBitFront]->free();
delete _buffers[kBitFront];
_buffers[kBitBack]->free();
delete _buffers[kBitBack];
- if (_buffers[kBit2])
+ if (_buffers[kBit2]) {
+ _buffers[kBit2]->free();
delete _buffers[kBit2];
+ }
delete _fonts[kFontDialogue];
delete _fonts[kFontLabel];