From: akl Date: Wed, 24 Sep 2014 12:29:15 +0000 (+0400) Subject: Getting current session, but not it's static reference. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=20e474586c8c20e112615e790c940def6b2c61d6;p=modules%2Fkernel.git Getting current session, but not it's static reference. --- diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index 5e853fdcd..2bc96b593 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -887,13 +887,15 @@ void SALOMEDS_Study_i::Close() itcomponent->UnRegister(); // Notify GUI that study is closed - SALOME::Session_var aSession = KERNEL::getSalomeSession(); + SALOME_NamingService *aNamingService = KERNEL::getNamingService(); + CORBA::Object_ptr obj = aNamingService->Resolve("/Kernel/Session"); + SALOME::Session_var aSession = SALOME::Session::_narrow(obj); if ( !CORBA::is_nil(aSession) ) { long studyId = aSession->GetActiveStudyId(); std::stringstream ss; ss << "studyClosed:" << studyId; std::string str = ss.str(); - aSession->emitMessage(str.c_str()); + aSession->emitMessageOneWay(str.c_str()); } _impl->Close();