]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Safeguarding ViewManager of crashing with "null-pointer" exceptions.
authorsbh <sbh@opencascade.com>
Mon, 10 Oct 2011 13:00:06 +0000 (13:00 +0000)
committersbh <sbh@opencascade.com>
Mon, 10 Oct 2011 13:00:06 +0000 (13:00 +0000)
src/SUIT/SUIT_ViewManager.cxx

index 00dd4123560c4eb643bc4b9e2406e611b306f992..4249fa872a1c4e55aa27404eadce654aa9b8a446 100755 (executable)
@@ -338,8 +338,10 @@ void SUIT_ViewManager::onWindowActivated(SUIT_ViewWindow* view)
 */
 void SUIT_ViewManager::closeAllViews()
 {
-  for ( int i = 0; i < myViews.size(); i++ )
-    delete myViews[i];
+  for ( int i = 0; i < myViews.size(); i++ ){
+    if( !myViews[i].isNull() )
+      delete myViews[i];
+  }
   myViews.clear();
 }