From: havoc Date: Tue, 22 May 2007 20:15:24 +0000 (+0000) Subject: close packs when clearing search path X-Git-Tag: xonotic-v0.1.0preview~3116 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7857d388ddfb0152d67d0e808d630f515e523740;p=xonotic%2Fdarkplaces.git close packs when clearing search path git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7340 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/fs.c b/fs.c index 6df06121..916bb960 100644 --- a/fs.c +++ b/fs.c @@ -1079,12 +1079,18 @@ FS_ClearSearchPath */ void FS_ClearSearchPath (void) { + // unload all packs and directory information, close all pack files + // (if a qfile is still reading a pack it won't be harmed because it used + // dup() to get its own handle already) while (fs_searchpaths) { searchpath_t *search = fs_searchpaths; fs_searchpaths = search->next; if (search->pack) { + // close the file + close(search->pack->handle); + // free any memory associated with it if (search->pack->files) Mem_Free(search->pack->files); Mem_Free(search->pack);