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:
parent
7a1a57381e
commit
85d52c2bff
2 changed files with 3 additions and 15 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue