mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
- more leaks plugged, plus rerouting exception messages to the log window.
This commit is contained in:
parent
0d908960ed
commit
1c46c6da9d
4 changed files with 15 additions and 16 deletions
|
@ -285,13 +285,6 @@ void I_StartupJoysticks();
|
|||
void I_ShutdownInput();
|
||||
int RunGame();
|
||||
|
||||
void ShutdownSystem()
|
||||
{
|
||||
Mus_Stop();
|
||||
if (soundEngine) delete soundEngine;
|
||||
I_ShutdownInput();
|
||||
}
|
||||
|
||||
int GameMain()
|
||||
{
|
||||
int r;
|
||||
|
@ -299,24 +292,28 @@ int GameMain()
|
|||
{
|
||||
r = RunGame();
|
||||
}
|
||||
catch (const std::runtime_error & err)
|
||||
{
|
||||
// shut down critical systems before showing a message box.
|
||||
ShutdownSystem();
|
||||
wm_msgbox("Error", "%s", err.what());
|
||||
return 3;
|
||||
}
|
||||
catch (const ExitEvent & exit)
|
||||
{
|
||||
// Just let the rest of the function execute.
|
||||
r = exit.Reason();
|
||||
}
|
||||
ShutdownSystem();
|
||||
catch (const std::exception & err)
|
||||
{
|
||||
// shut down critical systems before showing a message box.
|
||||
I_ShowFatalError(err.what());
|
||||
r = -1;
|
||||
}
|
||||
S_StopMusic(true);
|
||||
if (soundEngine) delete soundEngine;
|
||||
I_ShutdownInput();
|
||||
G_SaveConfig();
|
||||
C_DeinitConsole();
|
||||
V_ClearFonts();
|
||||
if (gi) delete gi;
|
||||
#ifndef NETCODE_DISABLE
|
||||
if (gHaveNetworking) enet_deinitialize();
|
||||
#endif
|
||||
DeleteStartupScreen();
|
||||
if (Args) delete Args;
|
||||
return r;
|
||||
}
|
||||
|
|
|
@ -983,6 +983,7 @@ TArray<GrpEntry> GrpScan()
|
|||
break;
|
||||
}
|
||||
}
|
||||
delete resf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1172,7 +1172,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE nothing, LPWSTR cmdline, int
|
|||
_CrtSetDbgFlag (_CrtSetDbgFlag(0) | _CRTDBG_LEAK_CHECK_DF);
|
||||
|
||||
// Use this to break at a specific allocation number.
|
||||
//_crtBreakAlloc = 167;
|
||||
//_crtBreakAlloc = 10563;
|
||||
#endif
|
||||
|
||||
int ret = DoMain (hInstance);
|
||||
|
|
|
@ -45,6 +45,7 @@ void I_Init (void);
|
|||
|
||||
// Return a seed value for the RNG.
|
||||
unsigned int I_MakeRNGSeed();
|
||||
void I_ShowFatalError(const char* msg);
|
||||
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue