Remove confusing comments and add in extra clarification - Bug #1534931

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9431 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-10-11 22:32:15 +00:00
commit 85d52c2bff
2 changed files with 3 additions and 15 deletions

View file

@ -21,14 +21,6 @@ public class main
caller.call();
caller.delCallback();
// Unlike Python, Java does not automatically support "weak"
// references (*), so we're left with managing the memory.
//
// (*) Yes, there is a WeakReference class, but it doesn't
// work exactly the way the Python weak reference works.
callback.delete();
callback = new JavaCallback();
System.out.println();
@ -39,6 +31,9 @@ public class main
caller.call();
caller.delCallback();
// Test that a double delete does not occur as the object has already been deleted from the C++ layer.
// Note that the garbage collector can also call the delete() method via the finalizer (callback.finalize())
// at any point after here.
callback.delete();
System.out.println();