[cig-commits] r6322 - in short/3D/PyLith/trunk: libsrc/materials
unittests/libtests/materials
brad at geodynamics.org
brad at geodynamics.org
Tue Mar 20 11:35:20 PDT 2007
Author: brad
Date: 2007-03-20 11:35:20 -0700 (Tue, 20 Mar 2007)
New Revision: 6322
Modified:
short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc
short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.cc
Log:
Fixed a couple small memory leaks.
Modified: short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc 2007-03-20 17:47:39 UTC (rev 6321)
+++ short/3D/PyLith/trunk/libsrc/materials/ElasticMaterial.cc 2007-03-20 18:35:20 UTC (rev 6322)
@@ -71,6 +71,7 @@
} // for
_calcDensity(paramsCell, numParams, numQuadPts);
_calcElasticConsts(paramsCell, numParams, numQuadPts);
+ delete[] paramsCell; paramsCell = 0;
} // calcProperties
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.cc 2007-03-20 17:47:39 UTC (rev 6321)
+++ short/3D/PyLith/trunk/unittests/libtests/materials/TestElasticMaterial.cc 2007-03-20 18:35:20 UTC (rev 6322)
@@ -38,6 +38,8 @@
CPPUNIT_ASSERT(0 != mycopy);
CPPUNIT_ASSERT(0 == strcmp(label, material.label().c_str()));
CPPUNIT_ASSERT_EQUAL(id, material.id());
+
+ delete mycopy; mycopy = 0;
} // testClone
// ----------------------------------------------------------------------
More information about the cig-commits
mailing list