From 7857d388ddfb0152d67d0e808d630f515e523740 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 22 May 2007 20:15:24 +0000 Subject: [PATCH] close packs when clearing search path git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7340 d7cf8633-e32d-0410-b094-e92efae38249 --- fs.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.39.2