From 5eada3cfb1bbe332b7da4511498f849cf382705d Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 24 Jan 2022 17:35:19 +0100 Subject: [PATCH] [tuleap,26948,26947,28734] : global fix --- src/SMESHClient/SMESH_Client.cxx | 15 +++++++++++++-- src/SMESHGUI/SMESHGUI.cxx | 11 ++--------- src/SMESH_I/SMESH_Gen_No_Session_i.cxx | 2 ++ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/SMESHClient/SMESH_Client.cxx b/src/SMESHClient/SMESH_Client.cxx index f0473ff66..6e0c37a5a 100644 --- a/src/SMESHClient/SMESH_Client.cxx +++ b/src/SMESHClient/SMESH_Client.cxx @@ -31,6 +31,7 @@ #include "SMESH_Component_Generator.hxx" #include "SALOME_NamingService.hxx" +#include "SALOME_Fake_NamingService.hxx" #include "SALOME_LifeCycleCORBA.hxx" #include @@ -39,6 +40,7 @@ #include CORBA_SERVER_HEADER(SALOME_Exception) #include "Basics_Utils.hxx" +#include "KernelBasis.hxx" #include "utilities.h" #ifdef WIN32 @@ -48,6 +50,7 @@ #endif #include +#include #ifndef EXCEPTION #define EXCEPTION(TYPE, MSG) {\ @@ -796,8 +799,16 @@ SMESH_Client::GetSMESHGen(CORBA::ORB_ptr theORB, long aClientPID = (long)getpid(); #endif - SALOME_NamingService aNamingService(theORB); - SALOME_LifeCycleCORBA aLifeCycleCORBA(&aNamingService); + std::unique_ptr aNamingService; + if(getSSLMode()) + { + aNamingService.reset(new SALOME_Fake_NamingService); + } + else + { + aNamingService.reset(new SALOME_NamingService(theORB)); + } + SALOME_LifeCycleCORBA aLifeCycleCORBA(aNamingService.get()); Engines::EngineComponent_var aComponent = aLifeCycleCORBA.FindOrLoad_Component("FactoryServer","SMESH"); aMeshGen = SMESH::SMESH_Gen::_narrow(aComponent); diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 46261a995..6cf1f3823 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -2139,15 +2139,8 @@ SMESHGUI::SMESHGUI() : SalomeApp_Module( "SMESH" ) if ( CORBA::is_nil( myComponentSMESH ) ) { CORBA::Boolean anIsEmbeddedMode; - SALOME_NamingService_Abstract *ns = SalomeApp_Application::namingService(); - if( dynamic_cast(ns) ) - myComponentSMESH = SMESH_Client::GetSMESHGen(getApp()->orb(),anIsEmbeddedMode); - else - { - Engines::EngineComponent_var comp = RetrieveSMESHInstance(); - myComponentSMESH = SMESH::SMESH_Gen::_narrow(comp); - } - + myComponentSMESH = SMESH_Client::GetSMESHGen(getApp()->orb(),anIsEmbeddedMode); + //MESSAGE("-------------------------------> anIsEmbeddedMode=" << anIsEmbeddedMode); // 0019923: EDF 765 SMESH : default values of hypothesis diff --git a/src/SMESH_I/SMESH_Gen_No_Session_i.cxx b/src/SMESH_I/SMESH_Gen_No_Session_i.cxx index 2b4e33cc2..d29b7257d 100644 --- a/src/SMESH_I/SMESH_Gen_No_Session_i.cxx +++ b/src/SMESH_I/SMESH_Gen_No_Session_i.cxx @@ -22,6 +22,7 @@ #include "SALOME_KernelServices.hxx" #include "SALOME_Fake_NamingService.hxx" #include "SALOME_ModuleCatalog_impl.hxx" +#include "Utils_SINGLETON.hxx" SMESH_Gen_No_Session_i::SMESH_Gen_No_Session_i( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, @@ -29,6 +30,7 @@ SMESH_Gen_No_Session_i::SMESH_Gen_No_Session_i( CORBA::ORB_ptr orb, const char* instanceName, const char* interfaceName):SMESH_Gen_i(orb,poa,contId,instanceName,interfaceName,false) { + myNS = SINGLETON_::Instance(); } GEOM::GEOM_Gen_var SMESH_Gen_No_Session_i::GetGeomEngine( bool isShaper ) -- 2.30.2