[cig-commits] r22009 - short/3D/PyLith/trunk/libsrc/pylith/meshio

brad at geodynamics.org brad at geodynamics.org
Thu May 9 08:47:08 PDT 2013


Author: brad
Date: 2013-05-09 08:47:07 -0700 (Thu, 09 May 2013)
New Revision: 22009

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterVTK.cc
Log:
Fixed cleanup when closing files. Account for possibility open() and openTimeStep() were never called.

Modified: short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterVTK.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterVTK.cc	2013-05-09 02:27:04 UTC (rev 22008)
+++ short/3D/PyLith/trunk/libsrc/pylith/meshio/DataWriterVTK.cc	2013-05-09 15:47:07 UTC (rev 22009)
@@ -214,7 +214,7 @@
   PYLITH_METHOD_BEGIN;
 
   // Account for possibility that no fields were written, so viewer doesn't have handle to DM.
-  if (_dm && !_wroteVertexHeader && !_wroteCellHeader) {
+  if (_dm && _viewer && !_wroteVertexHeader && !_wroteCellHeader) {
     // No fields written, so must manually dereference the mesh DM.
     PetscErrorCode err = PetscObjectDereference((PetscObject) _dm);PYLITH_CHECK_ERROR(err);
   } // if



More information about the CIG-COMMITS mailing list