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

brad at geodynamics.org brad at geodynamics.org
Fri Mar 30 19:53:24 PDT 2007


Author: brad
Date: 2007-03-30 19:53:24 -0700 (Fri, 30 Mar 2007)
New Revision: 6487

Modified:
   short/3D/PyLith/trunk/libsrc/meshio/MeshIO.cc
Log:
Fixed bugs in MeshIO. Must increment reference count when using temporary.

Modified: short/3D/PyLith/trunk/libsrc/meshio/MeshIO.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/MeshIO.cc	2007-03-31 02:44:32 UTC (rev 6486)
+++ short/3D/PyLith/trunk/libsrc/meshio/MeshIO.cc	2007-03-31 02:53:24 UTC (rev 6487)
@@ -82,6 +82,7 @@
 
   *_mesh = new Mesh(PETSC_COMM_WORLD, meshDim);
   ALE::Obj<Mesh>& mesh = *_mesh;
+  mesh.addRef();
   
   ALE::Obj<sieve_type> sieve = new sieve_type(mesh->comm());
 
@@ -104,6 +105,7 @@
 { // _getVertices
   assert(0 != _mesh);
   ALE::Obj<Mesh>& mesh = *_mesh;
+  mesh.addRef();
 
   const ALE::Obj<Mesh::label_sequence>& vertices = mesh->depthStratum(0);
   const ALE::Obj<Mesh::real_section_type>& coordsField =
@@ -147,6 +149,7 @@
 { // _getCells
   assert(0 != _mesh);
   ALE::Obj<Mesh>& mesh = *_mesh;
+  mesh.addRef();
 
   const ALE::Obj<sieve_type>& sieve = mesh->getSieve();
   const ALE::Obj<Mesh::label_sequence>& cells = mesh->heightStratum(0);
@@ -196,6 +199,7 @@
 { // _setMaterials
   assert(0 != _mesh);
   ALE::Obj<Mesh>& mesh = *_mesh;
+  mesh.addRef();
   
   const ALE::Obj<Mesh::label_sequence>& cells = mesh->heightStratum(0);
 
@@ -224,6 +228,7 @@
 { // _getMaterials
   assert(0 != _mesh);
   ALE::Obj<Mesh>& mesh = *_mesh;
+  mesh.addRef();
 
   const ALE::Obj<Mesh::label_sequence>& cells = mesh->heightStratum(0);
   const int numCells = cells->size();



More information about the cig-commits mailing list