--- deliantra/server/common/arch.C 2008/04/30 06:40:28 1.76 +++ deliantra/server/common/arch.C 2008/05/04 11:12:40 1.79 @@ -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 * @@ -513,11 +513,20 @@ else { LOG (llevDebug, "garbage collect arch %s", at->debug_desc ()); - assert (at->arch == at); // verify that refcnt == 1 is truely valid + assert (at->arch == at); // verify that refcnt == 1 is truly 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);