SALOME Forum bug: sub-mesh removal leads to an Exception in a re-opened study.

Now UnRegister(), corresponding to the Register() called by AttributeIOR,
is invoked by an object publisher i.e. by SMESH_Gen_i::publish() but not by GUI
because GUI is unable to track publication of all objects created by the Engine:
for example groups can be created while mesh.Compute() is called.
This commit is contained in:
eap 2013-07-22 14:40:00 +00:00
parent 5b15666f93
commit 74d40c014d

View File

@ -275,6 +275,10 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr theStudy,
CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theIOR ); CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theIOR );
SALOMEDS::AttributeIOR_wrap iorAttr = anAttr; SALOMEDS::AttributeIOR_wrap iorAttr = anAttr;
iorAttr->SetValue( objStr.in() ); iorAttr->SetValue( objStr.in() );
// UnRegister() !!!
SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR );
if ( !genObj->_is_nil() )
genObj->UnRegister();
} }
if ( thePixMap ) { if ( thePixMap ) {
anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributePixMap" ); anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributePixMap" );
@ -1189,6 +1193,5 @@ char* SMESH_Gen_i::GetParameters(CORBA::Object_ptr theObject)
aResult = strAttr->Value(); aResult = strAttr->Value();
} }
} }
return aResult._retn();
return CORBA::string_dup( aResult.in() );
} }