Skip to content

Commit

Permalink
- fixed crash on closing fatal error window
Browse files Browse the repository at this point in the history
Framebuffer was accessed after its destruction
  • Loading branch information
alexey-lysiuk authored and coelckers committed Oct 8, 2019
1 parent d87f759 commit f678b5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/d_main.cpp
Expand Up @@ -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();
Expand Down
10 changes: 7 additions & 3 deletions src/rendering/v_video.h
Expand Up @@ -663,9 +663,13 @@ class ScaleOverrider
savedyfac = CleanYfac;
savedwidth = CleanWidth;
savedheight = CleanHeight;
V_CalcCleanFacs(320, 200, screen->GetWidth(), screen->GetHeight(), &CleanXfac, &CleanYfac);
CleanWidth = screen->GetWidth() / CleanXfac;
CleanHeight = screen->GetHeight() / CleanYfac;

if (screen)
{
V_CalcCleanFacs(320, 200, screen->GetWidth(), screen->GetHeight(), &CleanXfac, &CleanYfac);
CleanWidth = screen->GetWidth() / CleanXfac;
CleanHeight = screen->GetHeight() / CleanYfac;
}
}

~ScaleOverrider()
Expand Down

0 comments on commit f678b5d

Please sign in to comment.