mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-03-21 02:01:03 +00:00
Fix assertion when switching to mod via menu, #458
The assertion that triggered was "assert(iconvDesc == (SDL_iconv_t)-1);" in Sys_InitInput() - because when loading a mod the window is recreated, calling Com_ReloadEngine_f() -> idCommonLocal::InitGame() -> idCommonLocal::InitRenderSystem() -> idCommonLocal::InitOpenGL() -> R_InitOpenGL() -> Sys_InitInput() Before that Com_ReloadEngine_f() calls commonLocal.ShutdownGame( true ); which calls the equivalent Shutdown() functions - except so far no one called Sys_ShutdownInput() (which closes iconvDesc and resets it to -1). Fixed that by making idRenderSystemLocal::ShutdownOpenGL() call it.
This commit is contained in:
parent
77e70b5df7
commit
b88b99fadb
1 changed files with 8 additions and 1 deletions
|
@ -2255,9 +2255,16 @@ idRenderSystemLocal::ShutdownOpenGL
|
|||
========================
|
||||
*/
|
||||
void idRenderSystemLocal::ShutdownOpenGL( void ) {
|
||||
// free the context and close the window
|
||||
|
||||
R_ShutdownFrameData();
|
||||
|
||||
// as the input is tied to the window, it should be shut down when the window
|
||||
// is destroyed (relevant when starting a mod which also recreates window)
|
||||
Sys_ShutdownInput();
|
||||
|
||||
// free the context and close the window
|
||||
GLimp_Shutdown();
|
||||
|
||||
glConfig.isInitialized = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue