From: nri Date: Wed, 16 Jul 2003 10:00:25 +0000 (+0000) Subject: NRI : Merge from V1_2. X-Git-Tag: V1_4_0~41 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=da30f087c7dde6554311b62ff7a5626a57558478;p=modules%2Fkernel.git NRI : Merge from V1_2. --- diff --git a/src/Loader/SALOME_Session_Loader.cxx b/src/Loader/SALOME_Session_Loader.cxx index 825fd0457..acd0ea377 100644 --- a/src/Loader/SALOME_Session_Loader.cxx +++ b/src/Loader/SALOME_Session_Loader.cxx @@ -40,50 +40,52 @@ int main(int argc, char **argv) if (myIS.getExitStatus()) exit(1); //VRV: T2.4 - Trace management improvement - try - { - CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv) ; - - SALOME_NamingService &NS = *SINGLETON_::Instance() ; - ASSERT(SINGLETON_::IsAlreadyExisting()) ; - NS.init_orb( orb ) ; - - CORBA::Object_var obj = NS.Resolve("/Kernel/Session"); - - SALOME::Session_var session = SALOME::Session::_narrow(obj) ; - ASSERT(! CORBA::is_nil(session)); - MESSAGE("SALOME::Session::_narrow(obj)"); - INFOS("Corba initialisation, Distant server"); - - // ------------------------------------------------------------- - - session->GetInterface() ; - - // ------------------------------------------------------------- - - orb->destroy() ; - } - catch (ServiceUnreachable&) - { - INFOS("Caught exception: Naming Service Unreachable"); - } - catch (CORBA::COMM_FAILURE&) - { - INFOS("Caught CORBA::SystemException CommFailure."); - } - catch (CORBA::SystemException&) - { - INFOS("Caught CORBA::SystemException."); - } - catch (CORBA::Exception&) - { - INFOS("Caught CORBA::Exception."); - } - catch (...) - { - INFOS("Caught unknown exception."); - } - return 0 ; + if (myIS.withGUI()) { + try + { + CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv) ; + + SALOME_NamingService &NS = *SINGLETON_::Instance() ; + ASSERT(SINGLETON_::IsAlreadyExisting()) ; + NS.init_orb( orb ) ; + + CORBA::Object_var obj = NS.Resolve("/Kernel/Session"); + + SALOME::Session_var session = SALOME::Session::_narrow(obj) ; + ASSERT(! CORBA::is_nil(session)); + MESSAGE("SALOME::Session::_narrow(obj)"); + INFOS("Corba initialisation, Distant server"); + + // ------------------------------------------------------------- + + session->GetInterface() ; + + // ------------------------------------------------------------- + + orb->destroy() ; + } + catch (ServiceUnreachable&) + { + INFOS("Caught exception: Naming Service Unreachable"); + } + catch (CORBA::COMM_FAILURE&) + { + INFOS("Caught CORBA::SystemException CommFailure."); + } + catch (CORBA::SystemException&) + { + INFOS("Caught CORBA::SystemException."); + } + catch (CORBA::Exception&) + { + INFOS("Caught CORBA::Exception."); + } + catch (...) + { + INFOS("Caught unknown exception."); + } + return 0 ; + } }