[QGIS Commit] r14173 - trunk/qgis/src/core/pal

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Sep 1 04:59:32 EDT 2010


Author: mhugent
Date: 2010-09-01 08:59:32 +0000 (Wed, 01 Sep 2010)
New Revision: 14173

Modified:
   trunk/qgis/src/core/pal/feature.cpp
Log:
Fix memory leak

Modified: trunk/qgis/src/core/pal/feature.cpp
===================================================================
--- trunk/qgis/src/core/pal/feature.cpp	2010-09-01 08:48:55 UTC (rev 14172)
+++ trunk/qgis/src/core/pal/feature.cpp	2010-09-01 08:59:32 UTC (rev 14173)
@@ -869,7 +869,10 @@
     }
 
     if ( total_distance == 0 )
+    {
+      delete[] path_distances;
       return 0;
+    }
 
     LinkedList<LabelPosition*> *positions = new LinkedList<LabelPosition*> ( ptrLPosCompare );
     double delta = max( f->labelInfo->label_height, total_distance / 10.0 );
@@ -941,6 +944,7 @@
       ( *lPos )[i] = positions->pop_front();
     }
     delete positions;
+    delete[] path_distances;
 
     return nbp;
   }



More information about the QGIS-commit mailing list