Skip to content
  • Jeff Baumes's avatar
    ENH: Updating Java wrapping to resolve memory leaking and race condition... · f98bdcda
    Jeff Baumes authored
    ENH: Updating Java wrapping to resolve memory leaking and race condition issues.  A thread-safe hash table of VTK pointers to Java objects is kept in the Java class vtkGlobalJavaHash, instead of in the C++ JNI layer.  All Java-wrapped VTK objects have a reference count owned by the Java wrapper (whether made from "new" or from the return value of a function).  That reference is deleted when the object is finalized.  To ensure all remaining objects are deleted at program termination the program should call vtkGlobalJavaHash.DeleteAll() just before exiting, which calls Delete() on the remaining Java-wrapped VTK objects.
    f98bdcda