aboutsummaryrefslogtreecommitdiff
path: root/engines/cge2/snail.cpp
diff options
context:
space:
mode:
authoruruk2014-07-17 15:18:55 +0200
committeruruk2014-07-17 15:18:55 +0200
commita82bd2d9c600cd50fc29c3078f9f2d8c79ea18ff (patch)
tree9b301c66702984e49159994c7ae9e203cd4d0ad6 /engines/cge2/snail.cpp
parent20eb951b3acf2c1d0be588f9375d3a92184aceee (diff)
downloadscummvm-rg350-a82bd2d9c600cd50fc29c3078f9f2d8c79ea18ff.tar.gz
scummvm-rg350-a82bd2d9c600cd50fc29c3078f9f2d8c79ea18ff.tar.bz2
scummvm-rg350-a82bd2d9c600cd50fc29c3078f9f2d8c79ea18ff.zip
CGE2: Fix memory leak regarding Sprite::ghost().
uint8 *v = new uint8; was the faulty line in Sprite::ghost(), and it should be released right here.
Diffstat (limited to 'engines/cge2/snail.cpp')
-rw-r--r--engines/cge2/snail.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp
index 84a0373ff5..5c152f4af1 100644
--- a/engines/cge2/snail.cpp
+++ b/engines/cge2/snail.cpp
@@ -722,8 +722,8 @@ void CGE2Engine::snDim(Sprite *spr, int val) {
void CGE2Engine::snGhost(Bitmap *bmp) {
V2D p(this, bmp->_map & 0xFFFF, bmp->_map >> 16);
bmp->hide(p);
+ bmp->release();
delete[] bmp->_b;
- bmp->_v = nullptr;
bmp->_b = nullptr;
delete bmp;
bmp = nullptr;