Skip to content

Commit

Permalink
TONY: Fix data freeing in DialogStart
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jun 10, 2012
1 parent 1668a23 commit e37319a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions engines/tony/custom.cpp
Expand Up @@ -1985,7 +1985,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr
// If there is only one option, do it automatically, and wait for the next choice
if (_ctx->num == 1) {
mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[0]);
globalFree(_ctx->sl);
globalDestroy(_ctx->sl);

// Wait for the next choice to be made
mpalQueryDialogWaitForChoice(&_ctx->nChoice);
Expand All @@ -2001,7 +2001,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr
_ctx->string = mpalQueryDialogPeriod(_ctx->sl[_ctx->i]);
assert(_ctx->string != NULL);
_ctx->dc.addChoice(_ctx->string);
globalFree(_ctx->string);
globalDestroy(_ctx->string);
}

// Activate the object
Expand All @@ -2028,7 +2028,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr
// Closes the choice
_ctx->dc.close();

globalFree(_ctx->sl);
globalDestroy(_ctx->sl);

// Wait for the next choice to be made
mpalQueryDialogWaitForChoice(&_ctx->nChoice);
Expand Down

0 comments on commit e37319a

Please sign in to comment.