Skip to content

Commit

Permalink
TSAGE: Fix memory leak and error in R2R Animation Player free
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Mar 3, 2012
1 parent 101ec2b commit 83f193e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions engines/tsage/graphics.cpp
Expand Up @@ -223,11 +223,13 @@ GfxSurface::GfxSurface() : _bounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) {
_lockSurfaceCtr = 0;
_customSurface = NULL;
_transColor = -1;
_trackDirtyRects = false;
}

GfxSurface::GfxSurface(const GfxSurface &s) {
_lockSurfaceCtr = 0;
_customSurface = NULL;
_trackDirtyRects = false;
this->operator =(s);
}

Expand Down
3 changes: 2 additions & 1 deletion engines/tsage/ringworld2/ringworld2_logic.cpp
Expand Up @@ -1927,7 +1927,8 @@ void AnimationPlayer::close() {
_animData2 = NULL;

_field38 = 0;
R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr, 0);
if (g_globals != NULL)
R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr, 0);
}

void AnimationPlayer::rleDecode(const byte *pSrc, byte *pDest, int size) {
Expand Down

0 comments on commit 83f193e

Please sign in to comment.