aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-09-29 21:16:43 -0400
committerPaul Gilbert2017-09-29 21:16:43 -0400
commit4d49c3db3ae0cce2fe7fa38c65a56c8795e629ac (patch)
tree3d67da655e8e1efd60dbe43527e71fb5e3d07241 /engines
parentfa3cc0ab53d7b560959b7cb0c88d3c01f0cb85ce (diff)
downloadscummvm-rg350-4d49c3db3ae0cce2fe7fa38c65a56c8795e629ac.tar.gz
scummvm-rg350-4d49c3db3ae0cce2fe7fa38c65a56c8795e629ac.tar.bz2
scummvm-rg350-4d49c3db3ae0cce2fe7fa38c65a56c8795e629ac.zip
TITANIC: Fix leaks in CGameState _movieList
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/game_state.cpp8
-rw-r--r--engines/titanic/game_state.h5
2 files changed, 6 insertions, 7 deletions
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 9bb83cc03a..7de069b97c 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 547e8f8221..731e94b792 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