diff options
-rw-r--r-- | engines/titanic/support/movie.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp index 9dc57b897a..33e7d33154 100644 --- a/engines/titanic/support/movie.cpp +++ b/engines/titanic/support/movie.cpp @@ -50,6 +50,15 @@ void CMovie::init() { } void CMovie::deinit() { + // Delete each movie in turn + for (CMovieList::iterator i = _playingMovies->begin(); i != _playingMovies->end(); ) { + // We need to increment iterator before deleting movie, + // since the CMovie destructor calls removeFromPlayingMovies + CMovie *movie = *i; + ++i; + delete movie; + } + delete _playingMovies; delete _movieSurface; } |