[mapserver-commits] r10440 - in trunk/mapserver: . mapscript/csharp

svn at osgeo.org svn at osgeo.org
Thu Aug 5 07:40:48 EDT 2010


Author: tamas
Date: 2010-08-05 11:40:48 +0000 (Thu, 05 Aug 2010)
New Revision: 10440

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapscript/csharp/Makefile.vc
   trunk/mapserver/mapscript/csharp/swig_csharp_extensions.i
Log:
Ensure the class is not marked BeforeFieldInit causing memory corruption with C#/CLR4 (#3438)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2010-08-04 20:18:09 UTC (rev 10439)
+++ trunk/mapserver/HISTORY.TXT	2010-08-05 11:40:48 UTC (rev 10440)
@@ -13,6 +13,8 @@
 
 Current Version (SVN trunk):
 ----------------------------
+- Ensure the class is not marked BeforeFieldInit causing memory corruption with C#/CLR4 (#3438)
+
 - Fixed MSSQL2008 driver returning invalid extent (#3498)
 
 - Added coordinate scaling to shpxy tag via parameters scale, scale_x or scale_y.

Modified: trunk/mapserver/mapscript/csharp/Makefile.vc
===================================================================
--- trunk/mapserver/mapscript/csharp/Makefile.vc	2010-08-04 20:18:09 UTC (rev 10439)
+++ trunk/mapserver/mapscript/csharp/Makefile.vc	2010-08-05 11:40:48 UTC (rev 10440)
@@ -48,7 +48,7 @@
 !ENDIF
 
 !IF $(MSVC_VER) >= 1600
-CSC = $(CSC) /define:CLR4 /debug:full
+CSC = $(CSC) /define:CLR4
 !ENDIF
 
 #SWIG = swig

Modified: trunk/mapserver/mapscript/csharp/swig_csharp_extensions.i
===================================================================
--- trunk/mapserver/mapscript/csharp/swig_csharp_extensions.i	2010-08-04 20:18:09 UTC (rev 10439)
+++ trunk/mapserver/mapscript/csharp/swig_csharp_extensions.i	2010-08-05 11:40:48 UTC (rev 10440)
@@ -29,6 +29,12 @@
  * DEALINGS IN THE SOFTWARE.
  *****************************************************************************/
 
+// Ensure the class is not marked BeforeFieldInit causing memory corruption with CLR4 
+%pragma(csharp) imclasscode=%{
+  static $imclassname() {
+  }
+%}
+
 %typemap(csout, excode=SWIGEXCODE) SWIGTYPE {
     $&csclassname ret = new $&csclassname($imcall, true, null);$excode
     return ret;



More information about the mapserver-commits mailing list