On 10/20/05, David James <james82@gmail.com> wrote:
> The Python/SWIG bindings definitely need better documentation. This is
> an important item on our TODO list.
>
> The new code in proxy_apr.swg is designed to "mark pools as invalid"
> when their parent pools have been garbage collected. I implemented
> this trick by registering a callback with the Python garbage
> collector, so that we can be notified when the parent pool is deleted.
>
> See below:
> self._weakparent = weakref.ref(self._parent_pool._is_valid,
> lambda x: _mark_weakpool_invalid(weakself))
>
> When the "self._parent_pool._is_valid" object is deleted, Python calls
> the _mark_weakpool_invalid function. The _mark_weakpool_invalid
> function marks the current pool as "destroyed", because its parent has
> been destroyed.
>
> Pools can be destroyed in one of three ways:
> pool.destroy()
> pool.clear()
> pool.__del__() (Called by Python garbage collector)
>
> All of the above functions destroy the "_is_valid" member object, thus
> triggering the _mark_weakpool_invalid function for all children. If
> the child pool has already been destroyed when the
> _mark_weakpool_invalid function is called, then the
> _mark_weakpool_invalid function does nothing.
>
> Garrett, does this explanation help?
Thanks! Everything is much more clear now. I'll try to turn your
email into a nice comment in proxy_apr.swg, so the next person who
tries to understand this stuff has an easier time than I did ;-)
-garrett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 20 22:15:32 2005