Improve javafinalize docs, patch from Marvin Greenberg
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13732 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
33bb317b61
commit
2a28514b27
1 changed files with 16 additions and 0 deletions
|
|
@ -5489,6 +5489,22 @@ interfaces (implements) for Java class: empty default
|
||||||
<p><tt>%typemap(javafinalize)</tt></p>
|
<p><tt>%typemap(javafinalize)</tt></p>
|
||||||
<div class="indent">
|
<div class="indent">
|
||||||
the <tt>finalize()</tt> method (proxy classes only): default calls the <tt>delete()</tt> method
|
the <tt>finalize()</tt> method (proxy classes only): default calls the <tt>delete()</tt> method
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Note that the default javafinalize typemap must contain the full implementation of the finalize method.
|
||||||
|
Any customization to this typemap must still declare a java finalize method with the correct signature.
|
||||||
|
Note also that the name of the generated "delete" method may be affected by <tt>javadestruct</tt> and <tt>javadestruct_derived</tt> typemaps.
|
||||||
|
Below shows an example modifying the finalizer, assuming the <tt>delete</tt> method has been renamed to <tt>swig_delete</tt>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="code"><pre>
|
||||||
|
%typemap(javafinalize) SWIGTYPE %{
|
||||||
|
protected void finalize() {
|
||||||
|
swig_delete(); // renamed to prevent conflict with existing delete method
|
||||||
|
}
|
||||||
|
]%
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue