Changeset - r24183:9296894dfeb7
[Not reviewed]
master
0 3 0
glx - 4 years ago 2020-05-10 14:04:04
glx@openttd.org
Fix: Stop any gamelog action when recovering from SlError()
3 files changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/gamelog.cpp
Show inline comments
 
@@ -87,6 +87,11 @@ void GamelogStopAction()
 
	if (print) GamelogPrintDebug(5);
 
}
 

	
 
void GamelogStopAnyAction()
 
{
 
	if (_gamelog_action_type != GLAT_NONE) GamelogStopAction();
 
}
 

	
 
/**
 
 * Frees the memory allocated by a gamelog
 
 */
src/gamelog.h
Show inline comments
 
@@ -27,6 +27,7 @@ enum GamelogActionType {
 

	
 
void GamelogStartAction(GamelogActionType at);
 
void GamelogStopAction();
 
void GamelogStopAnyAction();
 

	
 
void GamelogFree(struct LoggedAction *gamelog_action, uint gamelog_actions);
 
void GamelogReset();
src/saveload/saveload.cpp
Show inline comments
 
@@ -341,6 +341,10 @@ void NORETURN SlError(StringID string, c
 
	 * when we access them during cleaning the pool dereferences of
 
	 * those indices will be made with segmentation faults as result. */
 
	if (_sl.action == SLA_LOAD || _sl.action == SLA_PTRS) SlNullPointers();
 

	
 
	/* Logging could be active. */
 
	GamelogStopAnyAction();
 

	
 
	throw std::exception();
 
}
 

	
0 comments (0 inline, 0 general)