- fixed crash on closing fatal error window

Framebuffer was accessed after its destruction
This commit is contained in:
alexey.lysiuk 2019-10-08 13:18:59 +03:00 committed by Christoph Oelckers
parent d87f7593b8
commit f678b5d4d6
2 changed files with 8 additions and 4 deletions

View file

@ -2880,7 +2880,7 @@ void D_Cleanup()
M_SaveDefaults(NULL); // save config before the restart
// delete all data that cannot be left until reinitialization
screen->CleanForRestart();
if (screen) screen->CleanForRestart();
V_ClearFonts(); // must clear global font pointers
ColorSets.Clear();
PainFlashes.Clear();

View file

@ -663,10 +663,14 @@ public:
savedyfac = CleanYfac;
savedwidth = CleanWidth;
savedheight = CleanHeight;
if (screen)
{
V_CalcCleanFacs(320, 200, screen->GetWidth(), screen->GetHeight(), &CleanXfac, &CleanYfac);
CleanWidth = screen->GetWidth() / CleanXfac;
CleanHeight = screen->GetHeight() / CleanYfac;
}
}
~ScaleOverrider()
{