From fdd3e9a70c78b78b03aa8757281eb051d5e9f4bd Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 11 Apr 2017 15:02:52 +0300 Subject: [PATCH] Fix a crash. If call a visualization and then close the window Valentina will crash. --HG-- branch : release --- src/app/valentina/mainwindow.cpp | 1 + src/libs/vtools/tools/vabstracttool.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 2964eb56e..a1d90d3f4 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -1913,6 +1913,7 @@ void MainWindow::CancelTool() currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); + ui->view->itemClicked(nullptr); // Hide visualization to avoid a crash switch ( currentTool ) { diff --git a/src/libs/vtools/tools/vabstracttool.h b/src/libs/vtools/tools/vabstracttool.h index 6d3c74ba0..24d985d45 100644 --- a/src/libs/vtools/tools/vabstracttool.h +++ b/src/libs/vtools/tools/vabstracttool.h @@ -187,7 +187,7 @@ inline void VAbstractTool::AddVisualization() connect(scene, &VMainGraphicsScene::NewFactor, visual, &Visualization::SetFactor); scene->addItem(visual); - connect(visual, &Visualization::ToolTip, RECEIVER(this)[this] (const QString &toolTip) {emit ToolTip(toolTip);}); + connect(visual, &Visualization::ToolTip, this, &VAbstractTool::ToolTip); vis = visual; }