[Insight-developers] Re: LightObject race condition fix

Steve M. Robbins steve at sumost.ca
Mon Aug 13 01:50:15 EDT 2007


On Wed, Aug 08, 2007 at 06:09:43AM +1000, Dan Mueller wrote:
> On 07/08/07, Steve M. Robbins <steve at sumost.ca> wrote:
> > Developers: what is the use-case for SetReferenceCount()?
> 
> I know I use SetReferenceCount(): I have cases (to do with wrapping
> for .NET) where I do not know how many calls to Register() have gone
> before, but I do know when the object can be released. At that point I
> call SetReferenceCount(0) to force the pointer to be freed.

OK, I'll bite: how do you know that the object can be released?

I don't know anything about .NET and wrapping itk for it.  However, I
did once look into the java wrapping of vtk.  In that case, there is a
java proxy object for each C++ object and the proxy holds exactly one
reference to the C++ instance.  When the proxy is finalized, the
reference is decremented.  Can't this approach be used in ITK/.NET?

-Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.itk.org/mailman/private/insight-developers/attachments/20070813/96aa7227/attachment.pgp


More information about the Insight-developers mailing list