diff options
author | Paul Gilbert | 2011-04-10 09:29:42 +1000 |
---|---|---|
committer | Paul Gilbert | 2011-04-10 09:29:42 +1000 |
commit | 718660c7f12b04bc26f82b937c4ebf8e7490688d (patch) | |
tree | 27d91d2d2336dab5c8e44429dd2e62912fcb5622 /engines | |
parent | 9842dd9268951ab1631f1e2d098c5b4b0dc50d71 (diff) | |
download | scummvm-rg350-718660c7f12b04bc26f82b937c4ebf8e7490688d.tar.gz scummvm-rg350-718660c7f12b04bc26f82b937c4ebf8e7490688d.tar.bz2 scummvm-rg350-718660c7f12b04bc26f82b937c4ebf8e7490688d.zip |
TSAGE: Fix memory leak in the GfxSurface class
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/graphics.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index af28752dfd..0e800a8c0d 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -229,6 +229,8 @@ GfxSurface::GfxSurface(): _bounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) { } GfxSurface::GfxSurface(const GfxSurface &s) { + _lockSurfaceCtr = 0; + _customSurface = NULL; this->operator =(s); } @@ -314,6 +316,11 @@ GfxSurface &GfxSurface::operator=(const GfxSurface &s) { assert(_lockSurfaceCtr == 0); assert(s._lockSurfaceCtr == 0); + if (_customSurface) { + _customSurface->free(); + delete _customSurface; + } + _customSurface = s._customSurface; _screenSurface = s._screenSurface; _disableUpdates = s._disableUpdates; |