[Scummvm-git-logs] scummvm master -> 5ab826f135524e81d3719ded11970b6b5753eb61

dreammaster dreammaster at scummvm.org
Sun Sep 24 18:46:39 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:
5ab826f135 TITANIC: Add some guards against using the game manager during game exit


Commit: 5ab826f135524e81d3719ded11970b6b5753eb61
    https://github.com/scummvm/scummvm/commit/5ab826f135524e81d3719ded11970b6b5753eb61
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-09-24T12:46:32-04:00

Commit Message:
TITANIC: Add some guards against using the game manager during game exit

Changed paths:
    engines/titanic/core/game_object.cpp


diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index d52fa27..b6923c2 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -845,24 +845,34 @@ int CGameObject::addTimer(uint firstDuration, uint repeatDuration) {
 	CTimeEventInfo *timer = new CTimeEventInfo(getTicksCount(), repeatDuration != 0,
 		firstDuration, repeatDuration, this, 0, CString());
 
-	getGameManager()->addTimer(timer);
+	CGameManager *gameMan = getGameManager();
+	if (gameMan)
+		gameMan->addTimer(timer);
 	return timer->_id;
 }
 
 void CGameObject::stopTimer(int id) {
-	getGameManager()->stopTimer(id);
+	CGameManager *gameMan = getGameManager();
+	if (gameMan)
+		gameMan->stopTimer(id);
 }
 
 int CGameObject::startAnimTimer(const CString &action, uint firstDuration, uint repeatDuration) {
-	CTimeEventInfo *timer = new CTimeEventInfo(getTicksCount(), repeatDuration > 0,
-		firstDuration, repeatDuration, this, 0, action);
-	getGameManager()->addTimer(timer);
+	CGameManager *gameMan = getGameManager();
+	if (gameMan) {
+		CTimeEventInfo *timer = new CTimeEventInfo(getTicksCount(), repeatDuration > 0,
+			firstDuration, repeatDuration, this, 0, action);
+		gameMan->addTimer(timer);
+		return timer->_id;
+	}
 
-	return timer->_id;
+	return -1;
 }
 
 void CGameObject::stopAnimTimer(int id) {
-	getGameManager()->stopTimer(id);
+	CGameManager *gameMan = getGameManager();
+	if (gameMan)
+		gameMan->stopTimer(id);
 }
 
 void CGameObject::gotoView(const CString &viewName, const CString &clipName) {





More information about the Scummvm-git-logs mailing list