new typemap: csconstruct. This typemap contains the code that goes into the proxy constructor.
The generated code is slightly different. A method called swigSetup is called during construction of the proxy object. This is for a future change where a try finally block needs to be put around an unmanaged call during construction (for a new c++ to c# exception conversion handling mechanism) git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6924 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
2394fc2d86
commit
7ddc22dd99
1 changed files with 17 additions and 2 deletions
|
|
@ -433,6 +433,11 @@ $1 = &temp; %}
|
||||||
swigCPtr = cPtr;
|
swigCPtr = cPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual void swigSetup(IntPtr cPtr, bool cMemoryOwn) {
|
||||||
|
swigCMemOwn = cMemoryOwn;
|
||||||
|
swigCPtr = cPtr;
|
||||||
|
}
|
||||||
|
|
||||||
internal static IntPtr getCPtr($csclassname obj) {
|
internal static IntPtr getCPtr($csclassname obj) {
|
||||||
return (obj == null) ? IntPtr.Zero : obj.swigCPtr;
|
return (obj == null) ? IntPtr.Zero : obj.swigCPtr;
|
||||||
}
|
}
|
||||||
|
|
@ -442,7 +447,12 @@ $1 = &temp; %}
|
||||||
%typemap(csbody_derived) SWIGTYPE %{
|
%typemap(csbody_derived) SWIGTYPE %{
|
||||||
private IntPtr swigCPtr;
|
private IntPtr swigCPtr;
|
||||||
|
|
||||||
internal $csclassname(IntPtr cPtr, bool cMemoryOwn) : base($modulePINVOKE.$csclassnameUpcast(cPtr), cMemoryOwn) {
|
internal $csclassname(IntPtr cPtr, bool cMemoryOwn) : base((cPtr == IntPtr.Zero) ? cPtr : $modulePINVOKE.$csclassnameUpcast(cPtr), cMemoryOwn) {
|
||||||
|
swigCPtr = cPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void swigSetup(IntPtr cPtr, bool cMemoryOwn) {
|
||||||
|
base.swigSetup($modulePINVOKE.$csclassnameUpcast(cPtr), cMemoryOwn);
|
||||||
swigCPtr = cPtr;
|
swigCPtr = cPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -455,7 +465,7 @@ $1 = &temp; %}
|
||||||
%typemap(csbody) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) %{
|
%typemap(csbody) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) %{
|
||||||
private IntPtr swigCPtr;
|
private IntPtr swigCPtr;
|
||||||
|
|
||||||
internal $csclassname(IntPtr cPtr, bool bFutureUse) {
|
internal $csclassname(IntPtr cPtr, bool futureUse) {
|
||||||
swigCPtr = cPtr;
|
swigCPtr = cPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -474,6 +484,11 @@ $1 = &temp; %}
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
%typemap(csconstruct) SWIGTYPE %{: this(IntPtr.Zero, false) {
|
||||||
|
swigSetup($imcall, true);
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
%typemap(csdestruct, methodname="Dispose") SWIGTYPE {
|
%typemap(csdestruct, methodname="Dispose") SWIGTYPE {
|
||||||
if(swigCPtr != IntPtr.Zero && swigCMemOwn) {
|
if(swigCPtr != IntPtr.Zero && swigCMemOwn) {
|
||||||
swigCMemOwn = false;
|
swigCMemOwn = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue