]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Fixed crash after applying Import Image operation.
authorouv <ouv@opencascade.com>
Mon, 16 Sep 2013 10:41:04 +0000 (10:41 +0000)
committerouv <ouv@opencascade.com>
Mon, 16 Sep 2013 10:41:04 +0000 (10:41 +0000)
src/HYDROGUI/HYDROGUI_ImportImageOp.cxx

index 3ad1959d30b56bcc2ae585a643639ca30b72fcab..37fd753f8f3225ba81f3cbec8e00fffc1568b000 100644 (file)
@@ -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;