From: Anthony Geay Date: Mon, 24 Jan 2022 16:35:19 +0000 (+0100) Subject: [tuleap,26948,26947,28734] : global fix X-Git-Tag: V9_9_0a1~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5eada3cfb1bbe332b7da4511498f849cf382705d;p=modules%2Fsmesh.git [tuleap,26948,26947,28734] : global fix --- 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 )