[mapguide-commits] r9933 - in sandbox/jng/vanilla_swig/Bindings/src/SwigCommon: . Java Php

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri May 20 05:46:46 PDT 2022


Author: jng
Date: 2022-05-20 05:46:45 -0700 (Fri, 20 May 2022)
New Revision: 9933

Modified:
   sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Java/exception.i
   sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/exception.i
   sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/pointer.i
   sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/refcount.i
Log:
Suffix our refcounting diagnostic functions/macros with "Hook" to prevent calls to JNIEnv->NewObject in the Java API binding being interpreted as a macro

Modified: sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Java/exception.i
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Java/exception.i	2022-05-20 12:44:40 UTC (rev 9932)
+++ sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Java/exception.i	2022-05-20 12:46:45 UTC (rev 9933)
@@ -34,7 +34,7 @@
     if (mgException != NULL) {
         //AddRef the exception as this is a Ptr<> it will auto-unref when leaving the method
         (*mgException).AddRef();
-        RefCount(mgException);
+        RefCountHook(mgException);
         ThrowJavaExceptionWrapper(jenv, mgException);
     }
 }
\ No newline at end of file

Modified: sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/exception.i
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/exception.i	2022-05-20 12:44:40 UTC (rev 9932)
+++ sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/exception.i	2022-05-20 12:46:45 UTC (rev 9933)
@@ -61,7 +61,7 @@
     if (mgException != NULL) {
         //AddRef the exception as this is a Ptr<> it will auto-unref when leaving the method
         (*mgException).AddRef();
-        RefCount(mgException);
+        RefCountHook(mgException);
         ThrowPhpExceptionWrapper(mgException);
         SWIG_fail;
     }

Modified: sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/pointer.i
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/pointer.i	2022-05-20 12:44:40 UTC (rev 9932)
+++ sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/Php/pointer.i	2022-05-20 12:46:45 UTC (rev 9933)
@@ -22,7 +22,7 @@
     }
     SWIG_SetPointerZval($result, (void *)$1, ty, 1); /* owner = $owner */
     if ($owner) // is owner?
-        NewObject($1);
+        NewObjectHook($1);
     else
-        RefCount($1);
+        RefCountHook($1);
 }
\ No newline at end of file

Modified: sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/refcount.i
===================================================================
--- sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/refcount.i	2022-05-20 12:44:40 UTC (rev 9932)
+++ sandbox/jng/vanilla_swig/Bindings/src/SwigCommon/refcount.i	2022-05-20 12:46:45 UTC (rev 9933)
@@ -19,7 +19,7 @@
 #include "Foundation.h"
 
 #if defined(REFCOUNTING_DIAGNOSTICS)
-INT32 NewObject(MgDisposable* obj)
+INT32 NewObjectHook(MgDisposable* obj)
 {
     if (NULL != obj)
     {
@@ -34,7 +34,7 @@
     return -1;
 }
 
-INT32 RefCount(MgDisposable* obj)
+INT32 RefCountHook(MgDisposable* obj)
 {
     if (NULL != obj)
     {
@@ -63,8 +63,8 @@
     SAFE_RELEASE(obj);
 }
 #else
-#define NewObject(obj)
-#define RefCount(obj)
+#define NewObjectHook(obj)
+#define RefCountHook(obj)
 void ReleaseObject(MgDisposable* obj)
 {
     SAFE_RELEASE(obj);



More information about the mapguide-commits mailing list