From 3e51714a5b023fdfccfb7002d26cdfbeafe607cf Mon Sep 17 00:00:00 2001 From: mpa Date: Fri, 13 Jan 2017 15:50:54 +0300 Subject: [PATCH] fix problem with SALOMEDS_Server bug --- src/SALOMEDS/SALOMEDS.cxx | 6 ++++-- src/SALOMEDS/SALOMEDS_Server.cxx | 8 +++++--- src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/SALOMEDS/SALOMEDS.cxx b/src/SALOMEDS/SALOMEDS.cxx index 695992deb..23e4f3a20 100644 --- a/src/SALOMEDS/SALOMEDS.cxx +++ b/src/SALOMEDS/SALOMEDS.cxx @@ -118,8 +118,10 @@ extern "C" namingService.Register(aStudy, "/Study"); // Assign the value of the IOR in the study->root - CORBA::String_var IORStudy = orb->object_to_string(aStudy); - aStudy_i->GetImpl()->SetTransientReference((char*)IORStudy.in()); + if ( aStudy_i->GetImpl()->GetTransientReference().empty() ) { + CORBA::String_var IORStudy = orb->object_to_string(aStudy); + aStudy_i->GetImpl()->SetTransientReference((char*)IORStudy.in()); + } aStudy_i->_remove_ref(); } } diff --git a/src/SALOMEDS/SALOMEDS_Server.cxx b/src/SALOMEDS/SALOMEDS_Server.cxx index 21db9a8c0..addbbba1a 100644 --- a/src/SALOMEDS/SALOMEDS_Server.cxx +++ b/src/SALOMEDS/SALOMEDS_Server.cxx @@ -166,11 +166,13 @@ int main(int argc, char** argv) NS = SINGLETON_::Instance(); NS->init_orb( orb ); } - NS->Register(Study.in(), "/Study"); + NS->Register(Study, "/Study"); // Assign the value of the IOR in the study->root - CORBA::String_var IORStudy = orb->object_to_string(Study); - myStudy_i->GetImpl()->SetTransientReference((char*)IORStudy.in()); + if ( myStudy_i->GetImpl()->GetTransientReference().empty() ) { + CORBA::String_var IORStudy = orb->object_to_string(Study); + myStudy_i->GetImpl()->SetTransientReference((char*)IORStudy.in()); + } myStudy_i->_remove_ref(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 6e1e77792..42bc8839b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -522,7 +522,7 @@ bool SALOMEDSImpl_Study::Impl_SaveAs(const std::string& aStudyUrl, std::string component_name; // Store previous URL - std::string anOldName = Name(); + std::string anOldName = URL(); // Map to store components' versions std::map componentVersions; -- 2.39.2