From: Anthony Geay Date: Fri, 25 Jun 2021 15:21:18 +0000 (+0200) Subject: Fix TestExportToGEOM.py case in SSL mode X-Git-Tag: V9_8_0a1~39 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=161414f6bf3613033802ed703f4cd816fb508bfb;p=modules%2Fkernel.git Fix TestExportToGEOM.py case in SSL mode --- diff --git a/src/SALOMEDS/SALOMEDS_Driver_i.hxx b/src/SALOMEDS/SALOMEDS_Driver_i.hxx index 036c6c9e2..8ba6a897f 100644 --- a/src/SALOMEDS/SALOMEDS_Driver_i.hxx +++ b/src/SALOMEDS/SALOMEDS_Driver_i.hxx @@ -119,6 +119,8 @@ public: SALOMEDS_DriverFactory_i(CORBA::ORB_ptr theORB, SALOME_NamingService_Abstract *ns); + SALOME_NamingService_Abstract *getNS() const { return _name_service; } + virtual ~SALOMEDS_DriverFactory_i(); virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType); diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index f5dedf60f..96a37ba1d 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -51,6 +51,9 @@ #include "Basics_Utils.hxx" #include "SALOME_KernelServices.hxx" +#include "SALOME_Fake_NamingService.hxx" + +#include #ifdef WIN32 #include @@ -80,7 +83,8 @@ SALOMEDS::Study_ptr KERNEL::getStudyServantSA() CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); _poa = PortableServer::POA::_duplicate(poa); - SALOMEDS_Study_i *servant = new SALOMEDS_Study_i(orb,SALOME::Session::_nil()); + SALOME_Fake_NamingService ns; + SALOMEDS_Study_i *servant = new SALOMEDS_Study_i(orb,&ns); _study = servant->_this(); } return SALOMEDS::Study::_duplicate(_study); @@ -1220,10 +1224,11 @@ CORBA::Boolean SALOMEDS_Study_i::DumpStudy(const char* thePath, throw SALOMEDS::Study::StudyInvalidReference(); std::string aPath((char*)thePath), aBaseName((char*)theBaseName); - SALOMEDS_DriverFactory_i* factory = new SALOMEDS_DriverFactory_i(_orb); - bool ret = _impl->DumpStudy(aPath, aBaseName, isPublished, isMultiFile, factory); - delete factory; - + bool ret = false; + { + std::unique_ptr factory( new SALOMEDS_DriverFactory_i(_orb,_factory->getNS()) ); + ret = _impl->DumpStudy(aPath, aBaseName, isPublished, isMultiFile, factory.get()); + } return ret; }