diff options
author | Paul Gilbert | 2016-07-23 12:45:29 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-23 12:45:29 -0400 |
commit | 382ba52e332a02a49343c1ba1c2aed80dfcd5c87 (patch) | |
tree | 701f3b54a017d98c2d35292bc5844477740aafd4 | |
parent | 8dd24dd94530db499ead47dc4fda62194c179efd (diff) | |
download | scummvm-rg350-382ba52e332a02a49343c1ba1c2aed80dfcd5c87.tar.gz scummvm-rg350-382ba52e332a02a49343c1ba1c2aed80dfcd5c87.tar.bz2 scummvm-rg350-382ba52e332a02a49343c1ba1c2aed80dfcd5c87.zip |
TITANIC: Fix exit crash when a movie is active
-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; } |