I actually do a lot of clean-up management. There are 10k lines of code in this set of modules, and many dozens of objects get created at the beginning (and destroyed at the end) of even a one-liner invocation. But I've always
depended -- at bottom -- on the basic reference-counting rules to make sure that
object destruction happens in a safe order (and assumed that this
should work even during global destruction). Avoiding circular
references and other destroy-time problems has always been a big
concern: making sure there are no memory leaks in this code was a
primary goal from the very beginning of development.
But I would tend to think that you're right about there being some
corner-case oddity here. I guess, to re-state the question, what could
cause the following sequence of events:
- during normal operation: $foo->{bar} => Some::Object::Ref=HASH(0x86ed4c0)
- global destruction begins
- at some point during global destruction $foo->{bar} = undef
happens -- without any statement to that effect being executed,
(and Some::Object::Ref=HASH(0x86ed4c0) is still around and accessible
by other means).
The debugger shows that no code undefs $::index->{_def}. So,
either:
- The interpreter is allowed to reach in and yank references out
from under objects during global destruction. (And perhaps this is
what chromatic is saying about throwing reference counting by the
board when the interpreter is ready to exit.)
- The debugger is wrong.
- Or, I'm an idiot, and there's something quite different going on
here that I've managed to miss completely.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|