From b9038c74746fe1fcd8a51fcfb85bfdec81133c4b Mon Sep 17 00:00:00 2001 From: dmv Date: Mon, 11 Oct 2010 12:04:48 +0000 Subject: [PATCH] TC 5.1.5: SIGSEGV on closing study --- src/GEOMBase/GEOMBase_Helper.cxx | 10 ++++------ src/GroupGUI/GroupGUI_GroupDlg.cxx | 3 +-- src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx | 2 +- src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx | 3 +-- src/TransformationGUI/TransformationGUI_MirrorDlg.cxx | 2 +- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index 64bdc325f..02bc2980f 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -623,14 +623,12 @@ char* GEOMBase_Helper::getEntry( GEOM::GEOM_Object_ptr object ) const { SalomeApp_Study* study = getStudy(); if ( study ) { - char * objIOR = GEOMBase::GetIORFromObject( object ); + CORBA::String_var objIOR = GEOMBase::GetIORFromObject( object ); std::string IOR( objIOR ); - free( objIOR ); if ( IOR != "" ) { _PTR(SObject) SO ( study->studyDS()->FindObjectIOR( IOR ) ); - if ( SO ) { - return (char*) TCollection_AsciiString((char*)SO->GetID().c_str()).ToCString(); - } + if ( SO ) + return (char*) TCollection_AsciiString((char*)SO->GetID().c_str()).ToCString(); } } return (char*)""; @@ -1108,7 +1106,7 @@ void GEOMBase_Helper::addSubshapesToFather( QMap if ( aFatherEntry != "") { // additional checking that object is valid 0020598 EDF 1191 GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aFatherObj, it.key().toLatin1().data() ); //Add Object to study if its not exist - if ( aFindedObject->_is_nil() ) + if ( aFindedObject->_is_nil() ) GeometryGUI::GetGeomGen()->AddInStudy(GeometryGUI::ClientStudyToStudy(aDStudy), it.value(), it.key().toLatin1().data(), aFatherObj ); } diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index dcee8dbad..9771d89f6 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -1059,9 +1059,8 @@ bool GroupGUI_GroupDlg::execute(ObjectList& objects) SalomeApp_Study* study = getStudy(); if (study) { - char* objIOR = GEOMBase::GetIORFromObject(aGroup); + CORBA::String_var objIOR = GEOMBase::GetIORFromObject(aGroup); std::string IOR(objIOR); - free(objIOR); if (IOR != "") { _PTR(SObject) SO (study->studyDS()->FindObjectIOR(IOR)); if (SO) { diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx index 501517307..5344991b4 100644 --- a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx @@ -177,7 +177,7 @@ bool MeasureGUI_BndBoxDlg::getParameters( double& theXmin, double& theXmax, if ( CORBA::is_nil(aGeomGen) ) return false; - char* IOR = GEOMBase::GetIORFromObject( myObj ); + CORBA::String_var IOR = GEOMBase::GetIORFromObject( myObj ); GEOM::GEOM_Object_var anObject = aGeomGen->GetIORFromString(IOR); if ( CORBA::is_nil(anObject) ) return false; diff --git a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx index 15796bc2f..717dfa4a6 100644 --- a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx @@ -246,9 +246,8 @@ void RepairGUI_SuppressFacesDlg::SelectionIntoArgument() aSelMgr->clearSelected(); Standard_Boolean isOk; - char* objIOR = GEOMBase::GetIORFromObject(myObject); + CORBA::String_var objIOR = GEOMBase::GetIORFromObject(myObject); Handle(GEOM_AISShape) aSh = GEOMBase::ConvertIORinGEOMAISShape(objIOR, isOk, true); - free(objIOR); if (!isOk || aSh.IsNull()) return; diff --git a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx index bead55015..1b8810cbd 100644 --- a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx @@ -529,5 +529,5 @@ void TransformationGUI_MirrorDlg::addSubshapesToStudy() return; } addSubshapesToFather(objMap); - } + } } -- 2.39.2