[cig-commits] r13512 - cs/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Tue Dec 9 18:12:59 PST 2008


Author: luis
Date: 2008-12-09 18:12:59 -0800 (Tue, 09 Dec 2008)
New Revision: 13512

Modified:
   cs/cigma/trunk/src/Field.cpp
Log:
Watch out for empty shared pointers (in Field setters)

Modified: cs/cigma/trunk/src/Field.cpp
===================================================================
--- cs/cigma/trunk/src/Field.cpp	2008-12-10 02:12:57 UTC (rev 13511)
+++ cs/cigma/trunk/src/Field.cpp	2008-12-10 02:12:59 UTC (rev 13512)
@@ -1,7 +1,9 @@
 #include "Field.h"
+#include <cassert>
 using namespace cigma;
 using boost::shared_ptr;
 
+
 Field::Field()
 {
     mesh = shared_ptr<MeshPart>(new MeshPart);
@@ -14,16 +16,19 @@
 
 void Field::setMesh(const shared_ptr<MeshPart> mesh)
 {
+    assert(mesh);
     this->mesh = mesh;
 }
 
 void Field::setFE(const shared_ptr<FE> fe)
 {
+    assert(fe);
     this->fe = fe;
 }
 
 void Field::setDofHandler(const shared_ptr<DofHandler> dofs)
 {
+    assert(dofs);
     this->dofs = dofs;
 }
 



More information about the CIG-COMMITS mailing list