mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-18 01:21:32 +00:00
- fixed potential crashes in Linux crash reporter
Do not access various global objects at early stage of initialization and late stage of shutdown
This commit is contained in:
parent
08a66abde9
commit
279b327c6c
1 changed files with 33 additions and 25 deletions
|
@ -102,6 +102,12 @@ static int DoomSpecificInfo (char *buffer, char *end)
|
|||
#ifdef __VERSION__
|
||||
p += snprintf (buffer+p, size-p, "Compiler version: %s\n", __VERSION__);
|
||||
#endif
|
||||
|
||||
// If Args is nullptr, then execution is at either
|
||||
// * early stage of initialization, additional info contains only default values
|
||||
// * late stage of shutdown, most likely main() was done, and accessing global variables is no longer safe
|
||||
if (Args)
|
||||
{
|
||||
p += snprintf(buffer + p, size - p, "\nCommand line:");
|
||||
for (i = 0; i < Args->NumArgs(); ++i)
|
||||
{
|
||||
|
@ -135,6 +141,8 @@ static int DoomSpecificInfo (char *buffer, char *end)
|
|||
p += snprintf(buffer + p, size - p, "\nviewangle = %f", vp.Angles.Yaw.Degrees);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buffer[p++] = '\n';
|
||||
buffer[p++] = '\0';
|
||||
|
||||
|
|
Loading…
Reference in a new issue