]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
- removeObserver at the end
authorribes <ribes>
Fri, 30 Jul 2010 13:27:13 +0000 (13:27 +0000)
committerribes <ribes>
Fri, 30 Jul 2010 13:27:13 +0000 (13:27 +0000)
- could be notified by the launcher in the creation process

src/engine/BL_SALOMEServices.cxx
src/engine/BL_SALOMEServices.hxx
src/genericgui/BL_GenericGui.cxx

index 7cc8833efd226a48d6f21e0efcc385e8d52fcf6b..24ffcb069138b9259ea23790cbbc3e21768d9dd4 100644 (file)
@@ -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)
index 5170cf108e10e90740323d722f921fe50538d0b6..cdfdc777aed3a64dada4b38fc526e73c15c97249 100644 (file)
@@ -66,6 +66,7 @@ namespace BL{
       virtual ~SALOMEServices();
 
       bool initNS();
+      void end();
 
       void set_manager(BL::JobsManager * manager) {_manager = manager;}
 
index 8bcd27fa9b1251d90315b8e6d39ddb6e2b28b91f..2948f46c27ae574634e6f6dc761f9842c635a7d2 100644 (file)
@@ -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