[Scummvm-git-logs] scummvm master -> 4d49c3db3ae0cce2fe7fa38c65a56c8795e629ac

dreammaster dreammaster at scummvm.org
Sat Sep 30 03:18:59 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4d49c3db3a TITANIC: Fix leaks in CGameState _movieList


Commit: 4d49c3db3ae0cce2fe7fa38c65a56c8795e629ac
    https://github.com/scummvm/scummvm/commit/4d49c3db3ae0cce2fe7fa38c65a56c8795e629ac
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-09-29T21:16:43-04:00

Commit Message:
TITANIC: Fix leaks in CGameState _movieList

Changed paths:
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h


diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 9bb83cc..7de069b 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -31,16 +31,16 @@ namespace Titanic {
 
 bool CGameStateMovieList::empty() {
 	for (CGameStateMovieList::iterator i = begin(); i != end(); ) {
-		CMovieListItem *movieItem = *i;
+		CMovie *movie = *i;
 
-		if (movieItem->_item->isActive()) {
+		if (movie->isActive()) {
 			++i;
 		} else {
 			i = erase(i);
 		}
 	}
 
-	return List<CMovieListItem>::empty();
+	return Common::List<CMovie *>::empty();
 }
 
 /*------------------------------------------------------------------------*/
@@ -163,7 +163,7 @@ void CGameState::checkForViewChange() {
 }
 
 void CGameState::addMovie(CMovie *movie) {
-	_movieList.push_back(new CMovieListItem(movie));
+	_movieList.push_back(movie);
 	setMode(GSMODE_CUTSCENE);
 }
 
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 547e8f8..731e94b 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -45,13 +45,12 @@ enum Season {
 	SEASON_SPRING = 3
 };
 
-PTR_LIST_ITEM(CMovie);
-class CGameStateMovieList : public List<CMovieListItem> {
+class CGameStateMovieList : public Common::List<CMovie *> {
 public:
 	CViewItem *_destView;
 	CMovieClip *_movieClip;
 public:
-	CGameStateMovieList() : List<CMovieListItem>(), _destView(nullptr), _movieClip(nullptr) {}
+	CGameStateMovieList() : Common::List<CMovie *>(), _destView(nullptr), _movieClip(nullptr) {}
 
 	/**
 	 * Returns true if there are no movies in the list





More information about the Scummvm-git-logs mailing list