[cig-commits] r21772 - in short/3D/PyLith/trunk/libsrc/pylith: meshio topology
knepley at geodynamics.org
knepley at geodynamics.org
Mon Apr 8 13:00:22 PDT 2013
Author: knepley
Date: 2013-04-08 13:00:21 -0700 (Mon, 08 Apr 2013)
New Revision: 21772
Modified:
short/3D/PyLith/trunk/libsrc/pylith/meshio/CellFilterAvg.cc
short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc
Log:
Fixed more memory leaks
Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/CellFilterAvg.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/CellFilterAvg.cc 2013-04-08 18:18:58 UTC (rev 21771)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/CellFilterAvg.cc 2013-04-08 20:00:21 UTC (rev 21772)
@@ -118,6 +118,7 @@
err = ISGetIndices(cellIS, &cells);CHECK_PETSC_ERROR(err);
cStart = cells[0];
err = ISRestoreIndices(cellIS, &cells);CHECK_PETSC_ERROR(err);
+ err = ISDestroy(&cellIS);CHECK_PETSC_ERROR(err);
}
// Only processors with cells for output get the correct fiber dimension.
Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc 2013-04-08 18:18:58 UTC (rev 21771)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterHDF5Ext.cc 2013-04-08 20:00:21 UTC (rev 21772)
@@ -628,6 +628,7 @@
}
err = ISRestoreIndices(pointIS, &indices);CHECK_PETSC_ERROR(err);
}
+ err = ISDestroy(&pointIS);CHECK_PETSC_ERROR(err);
} else {
err = DMPlexGetCellNumbering(dmMesh, &globalCellNumbers);CHECK_PETSC_ERROR(err);
err = ISGetLocalSize(globalCellNumbers, &n);CHECK_PETSC_ERROR(err);
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc 2013-04-08 18:18:58 UTC (rev 21771)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc 2013-04-08 20:00:21 UTC (rev 21772)
@@ -1178,6 +1178,7 @@
err = PetscSectionView(gsection, PETSC_VIEWER_STDOUT_WORLD);CHECK_PETSC_ERROR(err);
} // if
err = DMSetDefaultGlobalSection(sinfo.dm, gsection);CHECK_PETSC_ERROR(err);
+ err = PetscSectionDestroy(&gsection);CHECK_PETSC_ERROR(err);
err = DMCreateGlobalVector(sinfo.dm, &sinfo.vector);CHECK_PETSC_ERROR(err);
err = PetscObjectSetName((PetscObject) sinfo.vector, _metadata["default"].label.c_str());CHECK_PETSC_ERROR(err);
PetscInt localSize, globalSize;
@@ -1186,7 +1187,7 @@
err = VecGetSize(sinfo.vector, &globalSize);CHECK_PETSC_ERROR(err);
/* assert(order->getLocalSize() == localSize); This does not work because the local vector includes the lagrange cell variables */
/* assert(order->getGlobalSize() == globalSize); */
- if (subSection) {err = PetscSectionDestroy(&subSection);CHECK_PETSC_ERROR(err);}
+ err = PetscSectionDestroy(&subSection);CHECK_PETSC_ERROR(err);
#if 0
std::cout << "["<<mesh.commRank()<<"] CONTEXT: " << context
<< ", orderLabel: " << orderLabel
More information about the CIG-COMMITS
mailing list