Browse Source

engine: always unlink variables and commands BEFORE all pointers to them would be lost

pull/2/head
Alibek Omarov 2 years ago
parent
commit
6a1f96a2c6
  1. 6
      engine/client/cl_game.c
  2. 6
      engine/client/cl_gameui.c
  3. 6
      engine/client/ref_common.c

6
engine/client/cl_game.c

@ -3874,13 +3874,13 @@ void CL_UnloadProgs( void ) @@ -3874,13 +3874,13 @@ void CL_UnloadProgs( void )
Cvar_FullSet( "cl_background", "0", FCVAR_READ_ONLY );
Cvar_FullSet( "host_clientloaded", "0", FCVAR_READ_ONLY );
Cvar_Unlink( FCVAR_CLIENTDLL );
Cmd_Unlink( CMD_CLIENTDLL );
COM_FreeLibrary( clgame.hInstance );
Mem_FreePool( &cls.mempool );
Mem_FreePool( &clgame.mempool );
memset( &clgame, 0, sizeof( clgame ));
Cvar_Unlink( FCVAR_CLIENTDLL );
Cmd_Unlink( CMD_CLIENTDLL );
}
qboolean CL_LoadProgs( const char *name )

6
engine/client/cl_gameui.c

@ -1218,12 +1218,12 @@ void UI_UnloadProgs( void ) @@ -1218,12 +1218,12 @@ void UI_UnloadProgs( void )
Cvar_FullSet( "host_gameuiloaded", "0", FCVAR_READ_ONLY );
Cvar_Unlink( FCVAR_GAMEUIDLL );
Cmd_Unlink( CMD_GAMEUIDLL );
COM_FreeLibrary( gameui.hInstance );
Mem_FreePool( &gameui.mempool );
memset( &gameui, 0, sizeof( gameui ));
Cvar_Unlink( FCVAR_GAMEUIDLL );
Cmd_Unlink( CMD_GAMEUIDLL );
}
qboolean UI_LoadProgs( void )

6
engine/client/ref_common.c

@ -379,14 +379,14 @@ static void R_UnloadProgs( void ) @@ -379,14 +379,14 @@ static void R_UnloadProgs( void )
Cvar_FullSet( "host_refloaded", "0", FCVAR_READ_ONLY );
Cvar_Unlink( FCVAR_RENDERINFO | FCVAR_GLCONFIG );
Cmd_Unlink( CMD_REFDLL );
COM_FreeLibrary( ref.hInstance );
ref.hInstance = NULL;
memset( &refState, 0, sizeof( refState ));
memset( &ref.dllFuncs, 0, sizeof( ref.dllFuncs ));
Cvar_Unlink( FCVAR_RENDERINFO | FCVAR_GLCONFIG );
Cmd_Unlink( CMD_REFDLL );
}
static void CL_FillTriAPIFromRef( triangleapi_t *dst, const ref_interface_t *src )

Loading…
Cancel
Save