Salome HOME
IPAL54097: SIGSEGV in Scalar Bar Properties dialog and crash in next operation
[modules/smesh.git] / src / OBJECT / SMESH_Object.cxx
index 3b9cd0b8ce28e9ad97222dccbb9caa0b1c4de46f..a1a69ff3fc4e4df79c066ceeaedf55cb468b1c94 100644 (file)
@@ -32,6 +32,8 @@
 #include "SMDS_Mesh.hxx"
 #include "SMDS_MeshCell.hxx"
 #include "SMDS_PolyhedralVolumeOfNodes.hxx"
+#include "SMESHDS_Mesh.hxx"
+#include "SMESHDS_Script.hxx"
 #include "SMESH_Actor.h"
 #include "SMESH_ControlsDef.hxx"
 
@@ -54,7 +56,7 @@
 #include <stdexcept>
 #include <set>
 
-#include "utilities.h"
+#include <utilities.h>
 
 using namespace std;
 
@@ -283,6 +285,8 @@ void SMESH_VisualObjDef::buildPrs(bool buildGrid)
       NulData(); // detach from the SMDS grid to allow immediate memory de-allocation in compactMesh()
       if ( MYDEBUG ) MESSAGE("*** buildPrs ==> compactMesh!");
       GetMesh()->compactMesh();
+      if ( SMESHDS_Mesh* m = dynamic_cast<SMESHDS_Mesh*>( GetMesh() )) // IPAL53915
+        m->GetScript()->SetModified(false); // drop IsModified set in compactMesh()
     }
     vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
     updateEntitiesFlags();
@@ -459,7 +463,7 @@ void SMESH_VisualObjDef::buildElemPrs()
 
         SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
         {
-          // Convertions connectivities from SMDS to VTK
+          // Convert connectivities from SMDS to VTK
 
           if (aType == SMDSAbs_Volume && anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE
             anIdList->Reset();
@@ -573,6 +577,8 @@ vtkUnstructuredGrid* SMESH_VisualObjDef::GetUnstructuredGrid()
   {
     NulData(); // detach from the SMDS grid to allow immediate memory de-allocation in compactMesh()
     GetMesh()->compactMesh();
+    if ( SMESHDS_Mesh* m = dynamic_cast<SMESHDS_Mesh*>( GetMesh() )) // IPAL53915
+      m->GetScript()->SetModified(false); // drop IsModified set in compactMesh()
     updateEntitiesFlags();
     vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
     myGrid->ShallowCopy(theGrid);