From 146fbd48fb8b0970e4f5bb473e4c4ec8270e22df Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 27 Mar 2006 12:23:15 +0000 Subject: [PATCH] Fix for Bug11695 Porting problem: CRASH after import of "ex15_cyl2geometry.py". --- src/SMESHGUI/SMESHGUI_Swig.cxx | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_Swig.cxx b/src/SMESHGUI/SMESHGUI_Swig.cxx index ad5b2c816..203db32de 100644 --- a/src/SMESHGUI/SMESHGUI_Swig.cxx +++ b/src/SMESHGUI/SMESHGUI_Swig.cxx @@ -609,8 +609,32 @@ SMESH_Swig::SetName(const char* theEntry, void SMESH_Swig::SetMeshIcon(const char* theMeshEntry, const bool theIsComputed) { - SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(theMeshEntry); - if(!aMeshSO->_is_nil()) - if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO)) - SMESH::ModifiedMesh(aMesh,theIsComputed); + class TEvent: public SALOME_Event + { + SALOMEDS::Study_var myStudy; + std::string myMeshEntry; + bool myIsComputed; + public: + TEvent(const SALOMEDS::Study_var& theStudy, + const std::string& theMeshEntry, + const bool theIsComputed): + myStudy(theStudy), + myMeshEntry(theMeshEntry), + myIsComputed(theIsComputed) + {} + + virtual + void + Execute() + { + SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(myMeshEntry.c_str()); + if(!aMeshSO->_is_nil()) + if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO)) + SMESH::ModifiedMesh(aMesh,myIsComputed); + } + }; + + ProcessVoidEvent(new TEvent(myStudy, + theMeshEntry, + theIsComputed)); } -- 2.39.2