[mapserver-commits] r9509 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Sat Oct 24 00:45:34 EDT 2009
Author: sdlime
Date: 2009-10-24 00:45:32 -0400 (Sat, 24 Oct 2009)
New Revision: 9509
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapshape.c
Log:
Fixed memory leak with shapefiles associated with one-pass query implementation. (#3188)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2009-10-23 17:59:43 UTC (rev 9508)
+++ trunk/mapserver/HISTORY.TXT 2009-10-24 04:45:32 UTC (rev 9509)
@@ -13,6 +13,9 @@
Current Version (SVN trunk):
----------------------------
+
+- Fixed memory leak with shapefiles associated with one-pass query implementation (#3188)
+
- Fix abs/fabs usage that prevented angle follow labels to be discarded if they
were too wrapped on themselves
Modified: trunk/mapserver/mapshape.c
===================================================================
--- trunk/mapserver/mapshape.c 2009-10-23 17:59:43 UTC (rev 9508)
+++ trunk/mapserver/mapshape.c 2009-10-24 04:45:32 UTC (rev 9509)
@@ -2292,10 +2292,18 @@
/************************************************************************/
int msTiledSHPCloseVT(layerObj *layer)
{
- msTiledSHPClose(layer);
- return MS_SUCCESS;
+ msTiledSHPClose(layer);
+ return MS_SUCCESS;
}
+void msTiledSHPLayerFreeItemInfo(layerObj *layer)
+{
+ if(layer->iteminfo) {
+ free(layer->iteminfo);
+ layer->iteminfo = NULL;
+ }
+}
+
int msTiledSHPLayerInitItemInfo(layerObj *layer)
{
msTiledSHPLayerInfo *tSHP=NULL;
@@ -2306,6 +2314,7 @@
return MS_FAILURE;
}
+ msTiledSHPLayerFreeItemInfo(layer);
layer->iteminfo = (int *) msDBFGetItemIndexes(tSHP->shpfile->hDBF, layer->items, layer->numitems);
if(!layer->iteminfo) return(MS_FAILURE);
@@ -2343,14 +2352,6 @@
return MS_SUCCESS;
}
-void msTiledSHPLayerFreeItemInfo(layerObj *layer)
-{
- if(layer->iteminfo) {
- free(layer->iteminfo);
- layer->iteminfo = NULL;
- }
-}
-
int msTiledSHPLayerIsOpen(layerObj *layer)
{
if(layer->layerinfo)
@@ -2387,6 +2388,14 @@
/* SHAPEFILE Layer virtual table functions */
+void msShapeFileLayerFreeItemInfo(layerObj *layer)
+{
+ if(layer->iteminfo) {
+ free(layer->iteminfo);
+ layer->iteminfo = NULL;
+ }
+}
+
int msShapeFileLayerInitItemInfo(layerObj *layer)
{
shapefileObj *shpfile = shpfile = layer->layerinfo;
@@ -2396,6 +2405,7 @@
}
/* iteminfo needs to be a bit more complex, a list of indexes plus the length of the list */
+ msShapeFileLayerFreeItemInfo(layer);
layer->iteminfo = (int *) msDBFGetItemIndexes(shpfile->hDBF, layer->items, layer->numitems);
if( ! layer->iteminfo) {
return MS_FAILURE;
@@ -2404,16 +2414,6 @@
return MS_SUCCESS;
}
-
-void msShapeFileLayerFreeItemInfo(layerObj *layer)
-{
- if(layer->iteminfo) {
- free(layer->iteminfo);
- layer->iteminfo = NULL;
- }
-}
-
-
int msShapeFileLayerOpen(layerObj *layer)
{
char szPath[MS_MAXPATHLEN];
More information about the mapserver-commits
mailing list