]> Creatis software - clitk.git/commitdiff
Debug Crop tool cancel
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Fri, 2 Dec 2016 08:59:43 +0000 (09:59 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Fri, 2 Dec 2016 08:59:43 +0000 (09:59 +0100)
A segmentation fault occured after a click on Cancel during image selection

vv/vvToolCropImage.cxx

index 1530341ce83456fa770bebe4e3b595cb9ed72927..736a7d696fc04549e4b24d0b0f988a457620cbbb 100644 (file)
@@ -105,12 +105,13 @@ void vvToolCropImage::closeEvent(QCloseEvent *event)
     for(int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++)
       mCurrentSlicerManager->GetSlicer(i)->EnableReducedExtent(false);
     UpdateExtent();
-  }
-  mCurrentSlicerManager->GetImage()->GetTransform()[0]->SetMatrix(mConcatenedTransform);
-  for (int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
-    mCurrentSlicerManager->GetSlicer(i)->ResetCamera();
-    mCurrentSlicerManager->GetSlicer(i)->Render();
-    mCurrentSlicerManager->UpdateLinkedNavigation( mCurrentSlicerManager->GetSlicer(i) );
+
+    mCurrentSlicerManager->GetImage()->GetTransform()[0]->SetMatrix(mConcatenedTransform);
+    for (int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
+      mCurrentSlicerManager->GetSlicer(i)->ResetCamera();
+      mCurrentSlicerManager->GetSlicer(i)->Render();
+      mCurrentSlicerManager->UpdateLinkedNavigation( mCurrentSlicerManager->GetSlicer(i) );
+    }
   }
   vvToolWidgetBase::closeEvent(event);
 }