On Thursday, January 3, 2002, at 11:57 AM, Perrin Harkins wrote: >> I don't have a test case involving Apache::Session yet (I've been out >> of >> town for a couple days), but here's a simple one in Perl that >> demonstrates the DESTROY order problem: > > That's sort of a weird example, since it has a circular reference. > Does it > have problems without the circular ref?
The circular reference was the only way I could think of to force an object to be destroyed during global destruction. I don't know whether it has a problem without circularity or not. > At a guess, I'd say you're making an unintentional closure somewhere. > Hmm, that may be - Mason does create more closures now than it used to. It seems like only 'named' closures would create this problem, though, and not 'anonymous' closures (since the refcount of the anonymous closure itself should go to zero, freeing its contents). Mason is supposed to be using all anonymous closures. I'm finding the destruction behavior highly unpredictable with the 'named' closure actually, so maybe I should bring it up on p5p. Perhaps the order of destruction is just random during global destruction, because I've seen it happen from the inside out & from the outside in. -Ken