From bf1975f425299a5ba4db6301121eab6ec6ac3f40 Mon Sep 17 00:00:00 2001 From: ouv Date: Mon, 16 Sep 2013 10:41:04 +0000 Subject: [PATCH] Fixed crash after applying Import Image operation. --- src/HYDROGUI/HYDROGUI_ImportImageOp.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx index 3ad1959d..37fd753f 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx @@ -479,6 +479,14 @@ void HYDROGUI_ImportImageOp::onPointSelected( bool theIsRefImage ) void HYDROGUI_ImportImageOp::closePreview() { + // It's very strange, but without calling this method (it's quite safe) a crash is stably reproduced. + // Scenario: create any non-Graphics view, activate import op, click apply. + // Result: a few SIGSEGVs coming from processEvents(), then crash. + if( myPreviewViewManager ) + if( GraphicsView_Viewer* aViewer = myPreviewViewManager->getViewer() ) + if( GraphicsView_ViewPort* aViewPort = aViewer->getActiveViewPort() ) + aViewPort->onBoundingRectChanged(); + if( myPreviewPrs ) { delete myPreviewPrs; -- 2.39.2