mirror of
https://github.com/UberGames/ioef.git
synced 2025-02-21 11:11:19 +00:00
Fix shfolder.dll not getting freed
This commit is contained in:
parent
0f62a565f9
commit
230af8c9e9
1 changed files with 8 additions and 9 deletions
|
@ -90,14 +90,14 @@ char *Sys_DefaultHomePath( void )
|
||||||
FARPROC qSHGetFolderPath;
|
FARPROC qSHGetFolderPath;
|
||||||
HMODULE shfolder = LoadLibrary("shfolder.dll");
|
HMODULE shfolder = LoadLibrary("shfolder.dll");
|
||||||
|
|
||||||
if(!*homePath && com_homepath)
|
|
||||||
{
|
|
||||||
if(shfolder == NULL)
|
if(shfolder == NULL)
|
||||||
{
|
{
|
||||||
Com_Printf("Unable to load SHFolder.dll\n");
|
Com_Printf("Unable to load SHFolder.dll\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!*homePath && com_homepath)
|
||||||
|
{
|
||||||
qSHGetFolderPath = GetProcAddress(shfolder, "SHGetFolderPathA");
|
qSHGetFolderPath = GetProcAddress(shfolder, "SHGetFolderPathA");
|
||||||
if(qSHGetFolderPath == NULL)
|
if(qSHGetFolderPath == NULL)
|
||||||
{
|
{
|
||||||
|
@ -120,10 +120,9 @@ char *Sys_DefaultHomePath( void )
|
||||||
Q_strcat(homePath, sizeof(homePath), com_homepath->string);
|
Q_strcat(homePath, sizeof(homePath), com_homepath->string);
|
||||||
else
|
else
|
||||||
Q_strcat(homePath, sizeof(homePath), HOMEPATH_NAME_WIN);
|
Q_strcat(homePath, sizeof(homePath), HOMEPATH_NAME_WIN);
|
||||||
|
|
||||||
FreeLibrary(shfolder);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FreeLibrary(shfolder);
|
||||||
return homePath;
|
return homePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue