diff options
-rw-r--r-- | engines/fullpipe/gfx.cpp | 13 | ||||
-rw-r--r-- | engines/fullpipe/gfx.h | 1 | ||||
-rw-r--r-- | engines/fullpipe/statics.cpp | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index 145f4e87b1..466f123ef8 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -779,6 +779,8 @@ Bitmap::Bitmap() { _flags = 0; _surface = 0; _flipping = Graphics::FLIP_NONE; + + _skipDelete = false; } Bitmap::Bitmap(Bitmap *src) { @@ -792,14 +794,21 @@ Bitmap::Bitmap(Bitmap *src) { _pixels = src->_pixels; _surface = new Graphics::TransparentSurface(*src->_surface); _flipping = src->_flipping; + + _skipDelete = true; } Bitmap::~Bitmap() { if (_pixels) free(_pixels); - _surface->free(); - delete _surface; + if (!_skipDelete) { + if (_surface) + _surface->free(); + delete _surface; + } + + _surface = 0; _pixels = 0; } diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h index 566586fb48..f8396c98cf 100644 --- a/engines/fullpipe/gfx.h +++ b/engines/fullpipe/gfx.h @@ -40,6 +40,7 @@ struct Bitmap { int _flags; Graphics::TransparentSurface *_surface; int _flipping; + bool _skipDelete; Bitmap(); Bitmap(Bitmap *src); diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index ab4e757c84..7f43fa0b1d 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -572,6 +572,8 @@ void Movement::draw(bool flipFlag, int angle) { } } } + + delete bmp; } void StaticANIObject::loadMovementsPixelData() { |