[vtkusers] VTK/Java crashes -- WeakGlobalRef or garbage collection problem...solution?

Nathan P Sharp vtkusers at nps.parcellsharp.net
Wed Dec 23 09:43:35 EST 2009


Denis Barbier escribió:
>
> Exactly, sorry if my wording was unclear.
>
> I pushed another branch java/proxyFinalize2 to gitorious with these
> changes.  When writing it, I found that Nathan's implementation is
> still subject to bug 8942; finalize() does not call Delete, and thus
> object is not removed from the global hash.  Nathan, do you want to
> fix it, or do I merge proxyFinalize2 into proxyFinalize?  Or did I
> miss something?
>   
Denis,
  It shouldn't matter since the Java Garbage Collector will null out the
weak reference for you.  However, explicitly removing it is a good idea
anyhow (especially since I'll be voting to have an option to override
the weak ref with a user supplied strong ref later).  I'm currently on
vacation so I can't actually try proxyFinalize2 at the moment, but it
makes perfect sense on inspection.  Thanks!

  I realized today that I need static native VTKDelete made public. 
Otherwise I won't be able to call it from my custom vtkIDisposeOnThread
implementation.

  Nathan




More information about the vtkusers mailing list