From 7c4ac6bfcfe0ce33631cc0feecedaa730e8c4f91 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 29 Apr 2024 16:59:30 +0300 Subject: [PATCH] Emitting in this case can cause a crash. --- src/app/valentina/mainwindow.cpp | 1 + src/libs/vtools/dialogs/tools/dialogtool.cpp | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index a05be55cd..f7ea0956b 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -896,6 +896,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons connect(scene, &VMainGraphicsScene::SelectedObject, m_dialogTool.data(), &DialogTool::SelectedObject); connect(m_dialogTool.data(), &DialogTool::DialogClosed, this, closeDialogSlot); connect(m_dialogTool.data(), &DialogTool::ToolTip, this, &MainWindow::ShowToolTip); + connect(m_dialogTool.data(), &DialogTool::destroyed, this, [this] { ShowToolTip(QString()); }); emit ui->view->itemClicked(nullptr); } else diff --git a/src/libs/vtools/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp index 1b11c8993..e828a3176 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp @@ -108,8 +108,6 @@ DialogTool::DialogTool(const VContainer *data, VAbstractPattern *doc, quint32 to //--------------------------------------------------------------------------------------------------------------------- DialogTool::~DialogTool() { - emit ToolTip(QString()); - if (not vis.isNull()) { delete vis;