--- deliantra/server/common/arch.C 2008/04/30 06:40:28 1.76 +++ deliantra/server/common/arch.C 2008/05/02 16:16:02 1.78 @@ -135,7 +135,7 @@ * - a corresponding object if found; a singularity object if not found. * Note by MSW - it appears that it takes the full name and keeps * shortening it until it finds a match. I re-wrote this so that it - * doesn't malloc it each time - not that this function is used much, + * doesn't allocate it each time - not that this function is used much, * but it otherwise had a big memory leak. */ object * @@ -515,9 +515,18 @@ LOG (llevDebug, "garbage collect arch %s", at->debug_desc ()); assert (at->arch == at); // verify that refcnt == 1 is truely valid allarch.erase (idx); - at->arch = 0; - at->more = 0; + + // break chain + for (object *op = at->head_ (); op; ) + { + object *next = op->more; + op->head = 0; + op->more = 0; + op = next; + } + at->destroy (); + at->arch = 0; } } while (--cnt);