fixed the renderer not always removing commands when it should

This commit is contained in:
myT 2017-10-04 00:35:26 +02:00
parent c3027a56b7
commit 62ff8ef1d1
3 changed files with 9 additions and 1 deletions

View file

@ -1650,7 +1650,6 @@ static void CL_ShutdownRef()
if ( !re.Shutdown ) {
return;
}
Cmd_UnregisterModule( MODULE_RENDERER );
re.Shutdown( qtrue );
Com_Memset( &re, 0, sizeof( re ) );
}
@ -1668,11 +1667,18 @@ static void RI_Cvar_RegisterTable( const cvarTableItem_t* cvars, int count )
}
static void RI_Cmd_UnregisterModule()
{
Cmd_UnregisterModule( MODULE_RENDERER );
}
static void CL_InitRef()
{
refimport_t ri;
ri.Cmd_RegisterTable = RI_Cmd_RegisterTable;
ri.Cmd_UnregisterModule = RI_Cmd_UnregisterModule;
ri.Cmd_Argc = Cmd_Argc;
ri.Cmd_Argv = Cmd_Argv;
ri.Printf = CL_RefPrintf;

View file

@ -620,6 +620,7 @@ static void RE_Shutdown( qbool destroyWindow )
ri.Printf( PRINT_DEVELOPER, "RE_Shutdown( %i )\n", destroyWindow );
if ( tr.registered ) {
ri.Cmd_UnregisterModule();
R_SyncRenderThread();
R_ShutdownCommandBuffers();
R_DeleteTextures();

View file

@ -198,6 +198,7 @@ typedef struct {
void (*Cvar_RegisterTable)( const cvarTableItem_t* cvars, int count );
void (*Cmd_RegisterTable)( const cmdTableItem_t* cmds, int count );
void (*Cmd_UnregisterModule)();
int (*Cmd_Argc)();
const char* (*Cmd_Argv)(int i);