[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mapguide-commits
Subject:    [mapguide-commits] r9933 - in sandbox/jng/vanilla_swig/Bindings/src/SwigCommon: . Java Php
From:       svn_mapguide () osgeo ! org
Date:       2022-05-20 12:46:46
Message-ID: 20220520124646.139791BE2F0 () trac ! osgeo ! org
[Download RAW message or body]

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);

_______________________________________________
mapguide-commits mailing list
mapguide-commits@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic