[tuleap,26948,26947,28734] : global fix

This commit is contained in:
Anthony Geay 2022-01-24 17:35:19 +01:00
parent a9cddd8ce9
commit 5eada3cfb1
3 changed files with 17 additions and 11 deletions

View 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);

View 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

View 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 )