Fix shfolder.dll not getting freed

This commit is contained in:
Tim Angus 2013-04-09 21:41:51 +01:00
parent 0f62a565f9
commit 230af8c9e9

View file

@ -90,14 +90,14 @@ char *Sys_DefaultHomePath( void )
FARPROC qSHGetFolderPath;
HMODULE shfolder = LoadLibrary("shfolder.dll");
if(!*homePath && com_homepath)
{
if(shfolder == NULL)
{
Com_Printf("Unable to load SHFolder.dll\n");
return NULL;
}
if(!*homePath && com_homepath)
{
qSHGetFolderPath = GetProcAddress(shfolder, "SHGetFolderPathA");
if(qSHGetFolderPath == NULL)
{
@ -120,10 +120,9 @@ char *Sys_DefaultHomePath( void )
Q_strcat(homePath, sizeof(homePath), com_homepath->string);
else
Q_strcat(homePath, sizeof(homePath), HOMEPATH_NAME_WIN);
FreeLibrary(shfolder);
}
FreeLibrary(shfolder);
return homePath;
}