From: ribes Date: Fri, 30 Jul 2010 13:27:13 +0000 (+0000) Subject: - removeObserver at the end X-Git-Tag: V6_2_0~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e70a5f41d70e7771472deb5d4c66ee503e53515b;p=modules%2Fjobmanager.git - removeObserver at the end - could be notified by the launcher in the creation process --- diff --git a/src/engine/BL_SALOMEServices.cxx b/src/engine/BL_SALOMEServices.cxx index 7cc8833..24ffcb0 100644 --- a/src/engine/BL_SALOMEServices.cxx +++ b/src/engine/BL_SALOMEServices.cxx @@ -44,8 +44,13 @@ BL::SALOMEServices::SALOMEServices() _manager = NULL; } -BL::SALOMEServices::~SALOMEServices() +BL::SALOMEServices::~SALOMEServices() {} + +void +BL::SALOMEServices::end() { + if (!CORBA::is_nil(_salome_launcher)) + _salome_launcher->removeObserver(_this()); if (_salome_naming_service) delete _salome_naming_service; if (_lcc) diff --git a/src/engine/BL_SALOMEServices.hxx b/src/engine/BL_SALOMEServices.hxx index 5170cf1..cdfdc77 100644 --- a/src/engine/BL_SALOMEServices.hxx +++ b/src/engine/BL_SALOMEServices.hxx @@ -66,6 +66,7 @@ namespace BL{ virtual ~SALOMEServices(); bool initNS(); + void end(); void set_manager(BL::JobsManager * manager) {_manager = manager;} diff --git a/src/genericgui/BL_GenericGui.cxx b/src/genericgui/BL_GenericGui.cxx index 8bcd27f..2948f46 100644 --- a/src/genericgui/BL_GenericGui.cxx +++ b/src/genericgui/BL_GenericGui.cxx @@ -32,13 +32,12 @@ BL::GenericGui::GenericGui(BL::MainWindows_Wrap * wrapper) : QObject(wrapper->ge // _salome_services is a servant // POA wil destroy it at the end of the application _salome_services = new BL::SALOMEServices(); - if (_salome_services->initNS() == false) - DEBMSG("WARNING !!!!! SALOME IS NOT REACHABLE !!!!"); } BL::GenericGui::~GenericGui() { DEBTRACE("Destroying BL::GenericGui"); + _salome_services->end(); } void @@ -84,6 +83,9 @@ BL::GenericGui::createDockWidgets() connect(_model, SIGNAL(rowsInserted(QModelIndex, int, int)), _summary, SLOT(rowsInserted(QModelIndex, int, int))); connect(_model, SIGNAL(rowsRemoved(QModelIndex, int, int)), _summary, SLOT(rowsRemoved(QModelIndex, int, int))); connect(_model, SIGNAL(itemChanged(QStandardItem*)), _summary, SLOT(itemChanged(QStandardItem*))); + + if (_salome_services->initNS() == false) + DEBMSG("WARNING !!!!! SALOME IS NOT REACHABLE !!!!"); } void