Salome HOME
[tuleap,26948,26947,28734] : global fix
authorAnthony Geay <anthony.geay@edf.fr>
Mon, 24 Jan 2022 16:35:19 +0000 (17:35 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Mon, 24 Jan 2022 16:35:19 +0000 (17:35 +0100)
src/SMESHClient/SMESH_Client.cxx
src/SMESHGUI/SMESHGUI.cxx
src/SMESH_I/SMESH_Gen_No_Session_i.cxx

index f0473ff66ae43334ce18e62f279260f7d87b7766..6e0c37a5ae004840c265c5db3227f95d7628b26b 100644 (file)
@@ -31,6 +31,7 @@
 #include "SMESH_Component_Generator.hxx"
 
 #include "SALOME_NamingService.hxx"
+#include "SALOME_Fake_NamingService.hxx"
 #include "SALOME_LifeCycleCORBA.hxx"
 
 #include <SALOMEconfig.h>
@@ -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 <stdexcept>
+#include <memory>
 
 #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<SALOME_NamingService_Abstract> 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);
 
index 46261a995601c9b0fccb6da0dadd92d9343f4788..6cf1f382341ca76351cab7f61b137bd9225f0c4e 100644 (file)
@@ -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<SALOME_NamingService *>(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
index 2b4e33cc2971788d2f10b09fe97c865a9eef657e..d29b7257d0dba8278bed6f34c55d3aecaf9c14a7 100644 (file)
@@ -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_<SALOME_Fake_NamingService>::Instance();
 }
 
 GEOM::GEOM_Gen_var SMESH_Gen_No_Session_i::GetGeomEngine( bool isShaper )