[mapserver-commits] r13290 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Mar 20 23:07:14 EDT 2012


Author: sdlime
Date: 2012-03-20 20:07:14 -0700 (Tue, 20 Mar 2012)
New Revision: 13290

Modified:
   trunk/mapserver/mapfile.c
   trunk/mapserver/mapserver.h
Log:
Added refcnt to labelObj just as done for styleObj, classObj, etc...

Modified: trunk/mapserver/mapfile.c
===================================================================
--- trunk/mapserver/mapfile.c	2012-03-20 16:31:55 UTC (rev 13289)
+++ trunk/mapserver/mapfile.c	2012-03-21 03:07:14 UTC (rev 13290)
@@ -1609,6 +1609,8 @@
 {
   int i;
 
+  MS_REFCNT_INIT(label);
+
   label->antialias = -1; /* off  */
   label->align = MS_ALIGN_LEFT;
   MS_INIT_COLOR(label->color, 0,0,0,255);  
@@ -1684,6 +1686,8 @@
 {
   int i;
 
+  if( MS_REFCNT_DECR_IS_NOT_ZERO(label) ) { return MS_FAILURE; }
+
   msFree(label->font);
   msFree(label->encoding);
 
@@ -3090,8 +3094,7 @@
         newsize = class->maxstyles + MS_STYLE_ALLOCSIZE;
 
         /* Alloc/realloc styles */
-        newStylePtr = (styleObj**)realloc(class->styles,
-                                          newsize*sizeof(styleObj*));
+        newStylePtr = (styleObj**)realloc(class->styles, newsize*sizeof(styleObj*));
         MS_CHECK_ALLOC(newStylePtr, newsize*sizeof(styleObj*), NULL);
 
         class->styles = newStylePtr;
@@ -3121,8 +3124,7 @@
         newsize = label->maxstyles + MS_STYLE_ALLOCSIZE;
 
         /* Alloc/realloc styles */
-        newStylePtr = (styleObj**)realloc(label->styles,
-                                          newsize*sizeof(styleObj*));
+        newStylePtr = (styleObj**)realloc(label->styles, newsize*sizeof(styleObj*));
         MS_CHECK_ALLOC(newStylePtr, newsize*sizeof(styleObj*), NULL);
 
         label->styles = newStylePtr;

Modified: trunk/mapserver/mapserver.h
===================================================================
--- trunk/mapserver/mapserver.h	2012-03-20 16:31:55 UTC (rev 13289)
+++ trunk/mapserver/mapserver.h	2012-03-21 03:07:14 UTC (rev 13290)
@@ -941,6 +941,14 @@
 /************************************************************************/
 
 typedef struct {
+#ifdef SWIG
+  %immutable;
+#endif /* SWIG */
+  int refcount;
+#ifdef SWIG
+  %mutable;
+#endif /* SWIG */
+
   char *font;
   enum MS_FONT_TYPE type;
     



More information about the mapserver-commits mailing list