mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-22 09:56:22 +01:00
filesystem: fix ClearSearchPath
This commit is contained in:
parent
0984368a31
commit
e95161aa14
@ -373,24 +373,27 @@ FS_ClearSearchPath
|
||||
*/
|
||||
void FS_ClearSearchPath( void )
|
||||
{
|
||||
while( fs_searchpaths )
|
||||
{
|
||||
searchpath_t *search = fs_searchpaths;
|
||||
searchpath_t *cur, **prev;
|
||||
|
||||
if( !search ) break;
|
||||
prev = &fs_searchpaths;
|
||||
|
||||
if( FBitSet( search->flags, FS_STATIC_PATH ))
|
||||
while( true )
|
||||
{
|
||||
// skip read-only pathes
|
||||
if( search->next )
|
||||
fs_searchpaths = search->next->next;
|
||||
else break;
|
||||
cur = *prev;
|
||||
|
||||
if( !cur )
|
||||
break;
|
||||
|
||||
// never delete static paths
|
||||
if( FBitSet( cur->flags, FS_STATIC_PATH ))
|
||||
{
|
||||
prev = &cur->next;
|
||||
continue;
|
||||
}
|
||||
else fs_searchpaths = search->next;
|
||||
|
||||
search->pfnClose( search );
|
||||
|
||||
Mem_Free( search );
|
||||
*prev = cur->next;
|
||||
cur->pfnClose( cur );
|
||||
Mem_Free( cur );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user