Salome HOME
Fix for IPAL9140: 3.0.0 (09 Jun): "Supervision" module has to be renamed into "Superv...
[modules/gui.git] / src / SalomeApp / SalomeApp_OBSelector.cxx
index ab8b10990df3e06198e8ded0276bfbe53d29755b..e40eecfc8b67be2cc36e0c14a58a2a95d05cfda1 100644 (file)
@@ -8,12 +8,13 @@
 #include <SUIT_DataObjectIterator.h>
 
 SalomeApp_OBSelector::SalomeApp_OBSelector( OB_Browser* ob, SUIT_SelectionMgr* mgr )
-: QObject( 0 ),
-SUIT_Selector( mgr ),
-myBrowser( ob )
+: SUIT_Selector( mgr, ob ),
+  myBrowser( ob )
 {
-  if ( myBrowser )
+  if ( myBrowser ) {
     connect( myBrowser, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) );
+    connect( myBrowser, SIGNAL( destroyed() ), this, SLOT( onBrowserDestroyed() ) ); 
+  }    
 }
 
 SalomeApp_OBSelector::~SalomeApp_OBSelector()
@@ -25,6 +26,7 @@ OB_Browser* SalomeApp_OBSelector::browser() const
   return myBrowser;
 }
 
+
 void SalomeApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& list ) const
 {
   if ( !myBrowser )
@@ -68,6 +70,11 @@ void SalomeApp_OBSelector::onSelectionChanged()
   selectionChanged();
 }
 
+void SalomeApp_OBSelector::onBrowserDestroyed()
+{
+  delete this;
+}
+
 void SalomeApp_OBSelector::fillEntries( QMap<QString, SalomeApp_DataObject*>& entires )
 {
   entires.clear();