[mapserver-commits] r7841 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri Aug 1 08:24:55 EDT 2008


Author: dmorissette
Date: 2008-08-01 08:24:55 -0400 (Fri, 01 Aug 2008)
New Revision: 7841

Modified:
   trunk/mapserver/mapfile.c
Log:
Fixed leak of layer resources if layerObj was freed before being closed (#2724)

Modified: trunk/mapserver/mapfile.c
===================================================================
--- trunk/mapserver/mapfile.c	2008-07-30 18:42:19 UTC (rev 7840)
+++ trunk/mapserver/mapfile.c	2008-08-01 12:24:55 UTC (rev 7841)
@@ -2530,10 +2530,13 @@
   int i;
   if (!layer) return MS_FAILURE;
   if( MS_REFCNT_DECR_IS_NOT_ZERO(layer) ) { return MS_FAILURE; }
-/*  if (layer->debug)
-     msDebug("freeLayer(): freeing layer at %p.\n",layer); 
-*/
 
+  if (layer->debug >= MS_DEBUGLEVEL_VVV)
+     msDebug("freeLayer(): freeing layer at %p.\n",layer);
+
+  if(msLayerIsOpen(layer))
+     msLayerClose(layer);
+
   msFree(layer->name);
   msFree(layer->group);
   msFree(layer->data);



More information about the mapserver-commits mailing list