diff options
Diffstat (limited to 'engines/cruise/cruise_main.cpp')
-rw-r--r-- | engines/cruise/cruise_main.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index e3e5b4c98d..6f5bf552fa 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -211,6 +211,17 @@ void resetPtr2(scriptInstanceStruct *ptr) { } void resetActorPtr(actorStruct *ptr) { + actorStruct *p = ptr; + + if (p->next) { + p = p->next; + do { + actorStruct *pNext = p->next; + MemFree(p); + p = pNext; + } while (p); + } + ptr->next = NULL; ptr->prev = NULL; } @@ -1983,6 +1994,7 @@ void CruiseEngine::mainLoop(void) { // Free data removeAllScripts(&relHead); removeAllScripts(&procHead); + resetActorPtr(&actorHead); freeOverlayTable(); closeCnf(); closeBase(); |