diff options
| -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; |
