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); } }