*/
//=============================================================================
-void SMESH_Gen_i::Close( SALOMEDS::SComponent_ptr theComponent )
+void SMESH_Gen_i::Close()
{
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Close" );
myStudyContext->Clear();
// remove the tmp files meshes are loaded from
- SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD( theComponent );
+ SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD();
// Clean trace of API methods calls
CleanPythonTrace();
SMESH::Measurements_ptr CreateMeasurements();
// Clears study-connected data when it is closed
- void Close( SALOMEDS::SComponent_ptr theComponent );
+ void Close();
// Get component data type
char* ComponentDataType();
*/
//================================================================================
-void SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD(SALOMEDS::SComponent_ptr smeshComp)
+void SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD()
{
if ( theMeshCounter > 0 )
{
- SALOMEDS::ChildIterator_wrap itBig = SMESH_Gen_i::getStudyServant()->NewChildIterator( smeshComp );
+ SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen();
+ if(!aGen)
+ return;
+
+ SALOMEDS::Study_var aStudy = SMESH_Gen_i::getStudyServant();
+ if(aStudy->_is_nil())
+ return;
+
+ CORBA::String_var compDataType = aGen->ComponentDataType();
+ SALOMEDS::SObject_wrap aSO = aStudy->FindComponent( compDataType.in() );
+
+ SALOMEDS::ChildIterator_wrap itBig = SMESH_Gen_i::getStudyServant()->NewChildIterator( aSO );
for ( ; itBig->More(); itBig->Next() ) {
SALOMEDS::SObject_wrap gotBranch = itBig->Value();
CORBA::Object_var anObject = SMESH_Gen_i::SObjectToObject( gotBranch );
// TEMPORARY method to remove study files on closing study;
// RIGHT WAY: study files are remove automatically when meshes are destroyed
- static void RemoveStudyFiles_TMP_METHOD(SALOMEDS::SComponent_ptr smeshComp);
+ static void RemoveStudyFiles_TMP_METHOD();
private: