From 47a4af4c82406ad77b50404dee5763707e56ff7e Mon Sep 17 00:00:00 2001 From: janwas Date: Sun, 30 May 2004 00:57:20 +0000 Subject: [PATCH] fixed bug found via mem leak: handles now closed at exit regardless of refcount This was SVN commit r323. --- source/lib/res/h_mgr.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/lib/res/h_mgr.cpp b/source/lib/res/h_mgr.cpp index 84bb11e4bc..fc7d8a4b9c 100755 --- a/source/lib/res/h_mgr.cpp +++ b/source/lib/res/h_mgr.cpp @@ -246,6 +246,11 @@ static void cleanup(void) // somewhat messy, but this only happens on cleanup. // better than an additional h_free(i32 idx) version though. Handle h = handle(i, hd->tag); + + // HACK: must actually free the handles, regardless + // of current refcount. so, quick'n dirty solution: set it to 0. + hd->refs = 0; + h_free(h, hd->type); } }