From: asl Date: Fri, 28 Mar 2008 13:09:57 +0000 (+0000) Subject: PAL19295: crash on study open X-Git-Tag: V5_0_0a1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=03104c24069c4749d97867733afb21f749c7aa53;p=modules%2Fgui.git PAL19295: crash on study open --- diff --git a/src/SUIT/SUIT_TreeModel.cxx b/src/SUIT/SUIT_TreeModel.cxx index 12dc98e56..b58523931 100755 --- a/src/SUIT/SUIT_TreeModel.cxx +++ b/src/SUIT/SUIT_TreeModel.cxx @@ -144,7 +144,7 @@ SUIT_TreeModel::TreeItem* SUIT_TreeModel::TreeItem::parent() const */ int SUIT_TreeModel::TreeItem::position() const { - return myParent->myChildren.indexOf( (TreeItem*)this ); + return myParent ? myParent->myChildren.indexOf( (TreeItem*)this ) : -1; } /*! diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 6a9c4b1dc..28a50cb1a 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -1127,14 +1127,11 @@ void SalomeApp_Application::updateObjectBrowser( const bool updateModels ) if ( aComponent->ComponentDataType() == "Interface Applicative" ) continue; // skip the magic "Interface Applicative" component - // temporary commented - /*OB_Browser* ob = static_cast( getWindow( WT_ObjectBrowser )); - const bool isAutoUpdate = ob->isAutoUpdate(); - ob->setAutoUpdate( false );*/ + getWindow( WT_ObjectBrowser ); + const bool isAutoUpdate = objectBrowser()->autoUpdate(); + objectBrowser()->setAutoUpdate( false ); SalomeApp_DataModel::synchronize( aComponent, study ); - // temporary commented - /*ob->setAutoUpdate( isAutoUpdate );*/ - //SalomeApp_DataModel::BuildTree( aComponent, study->root(), study, /*skipExisitng=*/true ); + objectBrowser()->setAutoUpdate( isAutoUpdate ); } } }