RE: [PATCH/RFC] Fix refcount on some Python callbacks
From: Bert Huijben \(TCG\) <b.huijben_at_competence.biz>
Date: Sun, 13 Apr 2008 13:58:06 +0200
> -----Original Message-----
> However, this patch doesn't decrement the reference counter once the
(I faced a few of the same issues while designing the SharpSvn library)
In some cases it's an option to do the cleanup from an apr pool cleanup function.
I use this for marshalling managed exception instances from the callback handlers back to the caller of the function.
As all errors have their own root apr pool, their pools are always cleared when svn_error_clear() is called; this makes it possible for the subversion library to clear an exception triggered by managed code.
In SharpSvn callbacks passed to subversion functions are kept alive by the functions calling the subversion functions; so they don't need special treatment. (And they call back into the managed code via a weak reference. This always succeeds as the calling function also has a reference)
(Using the apr pools in a try finally construction around all calls cleans up automatically on almost all thrown exceptions)
Bert Huijben
>
---------------------------------------------------------------------
|
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.