Message22906
Logged In: YES
user_id=31435
Bingo. This is a bit delicate <heh>. It's still necessary to call
_PyWeakref_ClearRef() on a trash weakref with a callback, to
prevent the callback from ever triggering (that was the key
to fixing the previous pile of bugs). For all other weakrefs to
trash, I think you're right that just setting wr_object to None
is conceptually enough. But ...
What I pissed away the last half hour discovering is that if
you set wr_object to None *before* calling
_PyWeakref_ClearRef(), then the latter doesn't do anything,
because clear_weakref() doesn't do anything when wr_object
is None.
So that leaves me a little worried: if we just set wr_object
to None on some weakrefs, then PyObject_ClearWeakrefs()
will never (and for the same reason) remove such a weakref
from its doubly-linked list either. Doesn't look like the
weakref code intended that this be possible, and I'm not yet
entirely convinced it can't hurt ... |
|
Date |
User |
Action |
Args |
2007-08-23 14:27:07 | admin | link | issue1055820 messages |
2007-08-23 14:27:07 | admin | create | |
|