From eeb170af2201dbaf8ea196917f39ad9ccf33ceaf Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 9 Jun 2022 13:41:37 +0300 Subject: [PATCH] engine: client: set failed status for vgui_support if we wasn't able to load one. Unload library in case of error --- engine/client/vgui/vgui_draw.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engine/client/vgui/vgui_draw.c b/engine/client/vgui/vgui_draw.c index 94ff455b..56f456f1 100644 --- a/engine/client/vgui/vgui_draw.c +++ b/engine/client/vgui/vgui_draw.c @@ -200,9 +200,14 @@ void VGui_Startup( const char *clientlib, int width, int height ) if( !s_pVGuiSupport ) { if( FS_FileExists( vguiloader, false )) + { Con_Reportf( S_ERROR "Failed to load vgui_support library: %s\n", COM_GetLibraryError() ); + } else + { Con_Reportf( "vgui_support: not found\n" ); + } + failed = true; } else { @@ -213,7 +218,11 @@ void VGui_Startup( const char *clientlib, int width, int height ) vgui.initialized = true; } else + { Con_Reportf( S_ERROR "Failed to find vgui_support library entry point!\n" ); + failed = true; + COM_FreeLibrary( s_pVGuiSupport ); + } } } }