diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index 0a7d7d0c..48472825 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -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 ) diff --git a/engine/client/cl_gameui.c b/engine/client/cl_gameui.c index 1d3af7ff..135c98c0 100644 --- a/engine/client/cl_gameui.c +++ b/engine/client/cl_gameui.c @@ -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 ) diff --git a/engine/client/ref_common.c b/engine/client/ref_common.c index 707852be..757573e6 100644 --- a/engine/client/ref_common.c +++ b/engine/client/ref_common.c @@ -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 )