[mapguide-commits] r6283 - trunk/MgDev/Common/CoordinateSystem

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Dec 2 13:28:12 EST 2011


Author: baertelchen
Date: 2011-12-02 10:28:12 -0800 (Fri, 02 Dec 2011)
New Revision: 6283

Modified:
   trunk/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp
Log:
This submission fixes ticket 1862 "CCoordinateSystemEnumInteger32 leaks memory when being destructed"
(http://trac.osgeo.org/mapguide/ticket/1862)

The main problem is, that the CCoordinateSystemEnumInteger32 class did not delete its [m_pnValues] array which holds all the Integer32 values upon destruction.

Added the delete[] call to the destructor.
Also added a call to the [ClearFilter] so that any such (auto-ptr'ed) values are also released.

Changes reviewed by Walt.

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp	2011-12-02 15:28:42 UTC (rev 6282)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp	2011-12-02 18:28:12 UTC (rev 6283)
@@ -34,6 +34,13 @@
 
 CCoordinateSystemEnumInteger32::~CCoordinateSystemEnumInteger32()
 {
+    this->ClearFilter();
+
+    delete[] this->m_pnValues;
+    this->m_pnValues = NULL;
+
+    this->m_ulSize = 0;
+    this->m_ulPos = 0;
 }
 
 //MgDisposable



More information about the mapguide-commits mailing list