From: imn Date: Tue, 22 Nov 2016 10:23:21 +0000 (+0300) Subject: Fixed problem after execute python command "myStudy.Init()" X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8d130bff7ac225cbab9f5095d9a8f2da34f48e49;p=modules%2Fyacs.git Fixed problem after execute python command "myStudy.Init()" --- diff --git a/idl/SALOMEDS.idl b/idl/SALOMEDS.idl index 8c37a73cd..f52389aa1 100644 --- a/idl/SALOMEDS.idl +++ b/idl/SALOMEDS.idl @@ -604,6 +604,10 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin /*! \brief Clear a study object */ void Clear(); + +/*! \brief Initialization a study object +*/ + void Init(); /*! \brief Open a study by url diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index 40894df09..a8bcfbd84 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -91,20 +91,30 @@ SALOMEDS_Study::SALOMEDS_Study(SALOMEDS::Study_ptr theStudy) _corba_impl = SALOMEDS::Study::_duplicate(theStudy); } - Init(); + InitORB(); } SALOMEDS_Study::~SALOMEDS_Study() { } -void SALOMEDS_Study::Init() +void SALOMEDS_Study::InitORB() { ORB_INIT &init = *SINGLETON_::Instance() ; ASSERT(SINGLETON_::IsAlreadyExisting()); _orb = init(0 , 0 ) ; } +void SALOMEDS_Study::Init() +{ + if (_isLocal) { + SALOMEDS::Locker lock; + _local_impl->Init(); + } + else + _corba_impl->Init(); +} + void SALOMEDS_Study::Clear() { if (_isLocal) { diff --git a/src/SALOMEDS/SALOMEDS_Study.hxx b/src/SALOMEDS/SALOMEDS_Study.hxx index 585487928..8d84ab6c2 100644 --- a/src/SALOMEDS/SALOMEDS_Study.hxx +++ b/src/SALOMEDS/SALOMEDS_Study.hxx @@ -53,6 +53,7 @@ public: ~SALOMEDS_Study(); virtual void Clear(); + virtual void Init(); virtual bool Open(const std::string& theStudyUrl); @@ -143,7 +144,7 @@ public: SALOMEDSImpl_Study* GetLocalImpl() { return _local_impl; } private: - void Init(); + void InitORB(); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index 51f96ea78..8091ece62 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -258,6 +258,9 @@ SALOMEDS_Study_i::~SALOMEDS_Study_i() //============================================================================ void SALOMEDS_Study_i::Init() { + if ( !_impl->GetDocument() ) + _impl->Init(); + _builder = new SALOMEDS_StudyBuilder_i(_impl->NewBuilder(), _orb); _notifier = new SALOMEDS::Notifier(_orb); _genObjRegister = new SALOMEDS::GenObjRegister(_orb);