Fix shfolder.dll not getting freed
This commit is contained in:
1 parent
0f62a565f9
commit
230af8c9e9
1 file changed
+8
-9
@@ -89,15 +89,15 @@ char *Sys_DefaultHomePath( void )
|
||||
TCHAR szPath[MAX_PATH];
|
||||
FARPROC qSHGetFolderPath;
|
||||
HMODULE shfolder = LoadLibrary("shfolder.dll");
|
||||
|
||||
|
||||
if(shfolder == NULL)
|
||||
{
|
||||
Com_Printf("Unable to load SHFolder.dll\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(!*homePath && com_homepath)
|
||||
{
|
||||
if(shfolder == NULL)
|
||||
{
|
||||
Com_Printf("Unable to load SHFolder.dll\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user