Salome HOME
removeObject(). Recursive invocation replaced by iterative references removing.
authorstv <stv@opencascade.com>
Wed, 21 Dec 2005 09:25:04 +0000 (09:25 +0000)
committerstv <stv@opencascade.com>
Wed, 21 Dec 2005 09:25:04 +0000 (09:25 +0000)
src/ObjBrowser/OB_Browser.cxx

index 272a4b66194d5297e7491fdbcea98ef0b78d4ad1..81ee7a6bf311c788bf4bdf017aa2756c5e4a48b0 100755 (executable)
@@ -1058,9 +1058,12 @@ void OB_Browser::removeObject( SUIT_DataObject* obj, const bool autoUpd )
   // Otherwise, "delete item" line will destroy all item's children,
   // and <myItems> will contain invalid pointers (see ~QListViewItem() description in Qt docs)
   DataObjectList childList;
-  obj->children( childList );
+  obj->children( childList, true );
   for ( DataObjectListIterator it( childList ); it.current(); ++it )
-    removeObject( it.current(), false );
+  {
+    it.current()->disconnect( this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
+    myItems.remove( it.current() );
+  }
 
   QListViewItem* item = listViewItem( obj );