diff options
author | Paul Gilbert | 2012-06-09 10:44:51 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-06-09 10:44:51 +1000 |
commit | dd8b4b519a2a61e010d9aa4d71b5f123dfeffc6b (patch) | |
tree | 022fe2eb0d8e35d8c8890c7576d611ef6267acfb /engines | |
parent | c52aca5ac407c498eb0a287697199a97f7c18bae (diff) | |
download | scummvm-rg350-dd8b4b519a2a61e010d9aa4d71b5f123dfeffc6b.tar.gz scummvm-rg350-dd8b4b519a2a61e010d9aa4d71b5f123dfeffc6b.tar.bz2 scummvm-rg350-dd8b4b519a2a61e010d9aa4d71b5f123dfeffc6b.zip |
TONY: Added more freeing of MPC data when the game ends
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tony/mpal/loadmpc.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/tony/mpal/loadmpc.cpp b/engines/tony/mpal/loadmpc.cpp index aa048c0b2f..e222891170 100644 --- a/engines/tony/mpal/loadmpc.cpp +++ b/engines/tony/mpal/loadmpc.cpp @@ -690,7 +690,7 @@ bool ParseMpc(const byte *lpBuf) { */ static void freeDialog(LPMPALDIALOG lpmdDialog) { // Free the periods - int i; + int i, j; for (i = 0; i < MAX_PERIODS_PER_DIALOG && (lpmdDialog->_periods[i]); ++i) globalFree(lpmdDialog->_periods[i]); @@ -702,6 +702,14 @@ static void freeDialog(LPMPALDIALOG lpmdDialog) { freeExpression(lpmdDialog->_command[i].expr); } } + + // Free the choices + for (i = 0; i < MAX_CHOICES_PER_DIALOG; ++i) { + for (j = 0; j < MAX_SELECTS_PER_CHOICE; j++) { + if (lpmdDialog->_choice[i]._select[j].when) + freeExpression(lpmdDialog->_choice[i]._select[j].when); + } + } } /** |