1
0
Fork 0

Fix: Stop any gamelog action when recovering from SlError()

pull/8287/head
glx 2020-05-10 16:04:04 +02:00 committed by Charles Pigott
parent bb251f45fc
commit 1072c74bc4
3 changed files with 10 additions and 0 deletions

View File

@ -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
*/

View File

@ -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();

View File

@ -341,6 +341,10 @@ void NORETURN SlError(StringID string, const char *extra_msg)
* 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();
}