Salome HOME
22874: [CEA 1425] Performance SMESH Module
[modules/smesh.git] / src / SMESH_I / SMESH_Mesh_i.cxx
index 0e298af615634bafdb57df3e949399806c94070b..5669a0b223231e19dc0a3abc51ca077bb57a4232 100644 (file)
@@ -161,6 +161,11 @@ SMESH_Mesh_i::~SMESH_Mesh_i()
   }
   _mapHypo.clear();
 
+  // clear cashed shapes if no more meshes remain; (the cash is blame,
+  // together with publishing, of spent time increasing in issue 22874)
+  if ( _impl->NbMeshes() == 1 )
+    _gen_i->GetShapeReader()->ClearClientBuffer();
+
   delete _editor; _editor = NULL;
   delete _previewEditor; _previewEditor = NULL;
   delete _impl; _impl = NULL;