cildispose and cildisposeoverride typemaps replaced by
csdestruct_base and csdestruct_derived typemaps. The delete() method has been removed and its functionality put into these typemaps designed for the Dispose method. New typemaps: csfinalize for finalizers. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4877 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9cccf88afa
commit
191a2cc071
2 changed files with 48 additions and 25 deletions
|
|
@ -428,17 +428,28 @@ $1 = &temp; %}
|
|||
%typemap(javainterfaces) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) ""
|
||||
%typemap(javaptrconstructormodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "internal"
|
||||
|
||||
%typemap(cildispose) SWIGTYPE %{
|
||||
public virtual void Dispose() {
|
||||
delete();
|
||||
%typemap(csfinalize) SWIGTYPE %{
|
||||
protected override void Finalize() {
|
||||
Dispose();
|
||||
}
|
||||
%}
|
||||
|
||||
%typemap(cildisposeoverride) SWIGTYPE %{
|
||||
public override void Dispose() {
|
||||
delete();
|
||||
%typemap(csdestruct_base) SWIGTYPE {
|
||||
if(swigCPtr != IntPtr.Zero && swigCMemOwn) {
|
||||
$jnicall;
|
||||
swigCMemOwn = false;
|
||||
}
|
||||
swigCPtr = IntPtr.Zero;
|
||||
}
|
||||
|
||||
%typemap(csdestruct_derived) SWIGTYPE {
|
||||
if(swigCPtr != IntPtr.Zero && swigCMemOwn) {
|
||||
$jnicall;
|
||||
swigCMemOwn = false;
|
||||
}
|
||||
swigCPtr = IntPtr.Zero;
|
||||
base.Dispose();
|
||||
}
|
||||
%}
|
||||
|
||||
%typemap(javagetcptr) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) %{
|
||||
internal static IntPtr getCPtr($javaclassname obj) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue