[mapserver-commits] r9406 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Oct 7 23:37:36 EDT 2009


Author: sdlime
Date: 2009-10-07 23:37:34 -0400 (Wed, 07 Oct 2009)
New Revision: 9406

Modified:
   trunk/mapserver/maplayer.c
Log:
Reset layer->items/numitems by hand rather than using the create items vtable function. (#3152)

Modified: trunk/mapserver/maplayer.c
===================================================================
--- trunk/mapserver/maplayer.c	2009-10-08 01:46:30 UTC (rev 9405)
+++ trunk/mapserver/maplayer.c	2009-10-08 03:37:34 UTC (rev 9406)
@@ -395,8 +395,12 @@
   **   note: if we don't reset then the items array is fully populated will ALL items
   */
   if(!get_all) {
-    rv = layer->vtable->LayerCreateItems(layer, numitems);
-    if (rv != MS_SUCCESS) return rv;
+    layer->items = (char **) calloc(numitems, sizeof(char *)); /* should be more than enough space */
+    if(!layer->items) {
+      msSetError(MS_MEMERR, NULL, "msLayerWhichItems()");
+      return MS_FAILURE;
+    }
+    layer->numitems = 0;
     freeitems = MS_TRUE;
   }
 



More information about the mapserver-commits mailing list