aboutsummaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2003-06-10 21:43:58 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2003-06-10 21:43:58 +0000
commit191a2cc071ffc7ce376a360bf8fd425d10cf4a12 (patch)
tree8b70aa0ac96d0111b2bc344fe53cc46779703c56 /Lib
parent9cccf88afa0bc760b75619da1ec7d3dd337ee9d9 (diff)
downloadswig-191a2cc071ffc7ce376a360bf8fd425d10cf4a12.tar.gz
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
Diffstat (limited to 'Lib')
-rw-r--r--Lib/csharp/csharp.swg25
1 files changed, 18 insertions, 7 deletions
diff --git a/Lib/csharp/csharp.swg b/Lib/csharp/csharp.swg
index 68871082b..dbc13a29f 100644
--- a/Lib/csharp/csharp.swg
+++ b/Lib/csharp/csharp.swg
@@ -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) {