diff --git a/src/xmlwrite.cpp b/src/xmlwrite.cpp --- a/src/xmlwrite.cpp +++ b/src/xmlwrite.cpp @@ -1446,7 +1446,10 @@ void Mesh::XMLReadCells(xmlNode *root) cells.clear(); Cell::NCells() = 0; - delete boundary_polygon; + if (boundary_polygon) { + delete boundary_polygon; + boundary_polygon=0; + } xmlNode *cur = root->xmlChildrenNode;