]> Creatis software - clitk.git/commitdiff
fix segfault when accessing vvToolCropImage in toolMenu when no image are opened.
authormpech <maxime.pech@insa-lyon.fr>
Mon, 23 May 2011 09:50:33 +0000 (11:50 +0200)
committermpech <maxime.pech@insa-lyon.fr>
Mon, 23 May 2011 09:50:33 +0000 (11:50 +0200)
This case should not happen if tools are disabled (see issue #461) when no image are opened.

vv/vvToolCropImage.cxx

index 58117561f5e0f3cb40d4637f97eea6b273cd4c95..2030407b614cfcc2df3d1b16607779e1fef99151 100644 (file)
@@ -86,7 +86,9 @@ void vvToolCropImage::closeEvent(QCloseEvent *event)
 {
   // Reset extends
   for(int i=0; i<mExtentSize; i++) mReducedExtent[i] = mInitialExtent[i];
-  UpdateExtent();
+  if(mCurrentSlicerManager){
+    UpdateExtent();
+  }
   event->accept();
 }
 //------------------------------------------------------------------------------