Salome HOME
refs #669, #677: selection of land covers in extended mode without pressing Shift...
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_DataModelSync.cxx
index 36405be28d475db41d61584166853f7f80a1ce5a..b73f3a401405c9bff23c0feb8c1af39552113735 100644 (file)
@@ -1,3 +1,20 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #include <HYDROGUI_DataModelSync.h>
 #include <HYDROGUI_DataObject.h>
@@ -17,12 +34,8 @@ void HYDROGUI_DataModelSync::deleteItemWithChildren( const suitPtr& theSuitPtr )
   if( !theSuitPtr )
     return;
 
-  DataObjectList aChildren;
-  theSuitPtr->children( aChildren );
-  foreach( SUIT_DataObject* anObj, aChildren )
-    deleteItemWithChildren( anObj );
-
-  delete theSuitPtr;
+  theSuitPtr->setAutoDeleteChildren( true );
+  theSuitPtr->deleteLater();
 }
 
 suitPtr HYDROGUI_DataModelSync::nullSrc() const