]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Clear all TreeItem instances in SUIT_TreeModel::setRoot() when autoDeleteTree ==...
authorsan <san@opencascade.com>
Wed, 28 Mar 2012 17:38:09 +0000 (17:38 +0000)
committersan <san@opencascade.com>
Wed, 28 Mar 2012 17:38:09 +0000 (17:38 +0000)
src/SUIT/SUIT_TreeModel.cxx

index a6ff0c455a7efbea4694019ed4679cad8544a5f9..8893581a23935a7483781bc8079669c5c2300fbd 100755 (executable)
@@ -775,6 +775,12 @@ void SUIT_TreeModel::setRoot( SUIT_DataObject* r )
     SUIT_DataObject::disconnect( SIGNAL( removed( SUIT_DataObject*, SUIT_DataObject* ) ),
                                  this, SLOT( onRemoved( SUIT_DataObject*, SUIT_DataObject* ) ) );
     delete myRoot;
+    
+    if ( myRootItem ) {
+      QList<TreeItem*> items = myRootItem->children();
+      for ( QList<TreeItem*>::iterator anIt = items.begin(); anIt != items.end(); anIt++ )
+        delete *anIt;
+    }
   }
 
   myRoot = r;