From 2d8615b096cd751ff231fb3dc96b578a5b72dc3f Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 25 Aug 2010 10:25:28 +0000 Subject: [PATCH] Minor fix: avoid crash in clearPrs() function, if view manager has been reset to 0 --- src/Plot2d/Plot2d_ViewModel.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Plot2d/Plot2d_ViewModel.cxx b/src/Plot2d/Plot2d_ViewModel.cxx index 2e912da1a..a36346e0b 100755 --- a/src/Plot2d/Plot2d_ViewModel.cxx +++ b/src/Plot2d/Plot2d_ViewModel.cxx @@ -121,7 +121,9 @@ void Plot2d_Viewer::update() void Plot2d_Viewer::clearPrs() { SUIT_ViewManager* aMgr = getViewManager(); - QVector aViews = aMgr->getViews(); + QVector aViews; + if ( aMgr ) + aViews = aMgr->getViews(); unsigned int aSize = aViews.size(); for (uint i = 0; i < aSize; i++) { Plot2d_ViewWindow* aView = (Plot2d_ViewWindow*)aViews[i]; -- 2.39.2