mirror of https://github.com/OpenTTD/OpenTTD
Fix: survey result on crash only worked on Linux (#10855)
Every OS-specific crashlog handler has their own MakeCrashLog in some form. In result, only Linux was calling the generic one.pull/10856/head
parent
98dffc3157
commit
0850193a38
|
@ -454,6 +454,13 @@ bool CrashLog::WriteScreenshot(char *filename, const char *filename_last) const
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CrashLog::SendSurvey() const
|
||||||
|
{
|
||||||
|
if (_game_mode == GM_NORMAL) {
|
||||||
|
_survey.Transmit(NetworkSurveyHandler::Reason::CRASH, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes the crash log, writes it to a file and then subsequently tries
|
* Makes the crash log, writes it to a file and then subsequently tries
|
||||||
* to make a crash dump and crash savegame. It uses DEBUG to write
|
* to make a crash dump and crash savegame. It uses DEBUG to write
|
||||||
|
@ -512,9 +519,7 @@ bool CrashLog::MakeCrashLog() const
|
||||||
printf("Writing crash screenshot failed.\n\n");
|
printf("Writing crash screenshot failed.\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_game_mode == GM_NORMAL) {
|
this->SendSurvey();
|
||||||
_survey.Transmit(NetworkSurveyHandler::Reason::CRASH, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,6 +99,8 @@ public:
|
||||||
bool WriteSavegame(char *filename, const char *filename_last) const;
|
bool WriteSavegame(char *filename, const char *filename_last) const;
|
||||||
bool WriteScreenshot(char *filename, const char *filename_last) const;
|
bool WriteScreenshot(char *filename, const char *filename_last) const;
|
||||||
|
|
||||||
|
void SendSurvey() const;
|
||||||
|
|
||||||
bool MakeCrashLog() const;
|
bool MakeCrashLog() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -192,6 +192,8 @@ public:
|
||||||
ret = false;
|
ret = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->SendSurvey();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -564,6 +564,7 @@ static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
|
||||||
log->AppendDecodedStacktrace(buf, lastof(log->crashlog));
|
log->AppendDecodedStacktrace(buf, lastof(log->crashlog));
|
||||||
log->WriteCrashLog(log->crashlog, log->crashlog_filename, lastof(log->crashlog_filename));
|
log->WriteCrashLog(log->crashlog, log->crashlog_filename, lastof(log->crashlog_filename));
|
||||||
log->WriteScreenshot(log->screenshot_filename, lastof(log->screenshot_filename));
|
log->WriteScreenshot(log->screenshot_filename, lastof(log->screenshot_filename));
|
||||||
|
log->SendSurvey();
|
||||||
|
|
||||||
/* Close any possible log files */
|
/* Close any possible log files */
|
||||||
CloseConsoleLogIfActive();
|
CloseConsoleLogIfActive();
|
||||||
|
|
Loading…
Reference in New Issue