diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index cc3c7f861..7d542ec31 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -4143,13 +4143,14 @@ void MainWindow::CreateActions() if (dialogFMeasurements.isNull()) { dialogFMeasurements = new DialogFinalMeasurements(doc, this); + dialogFMeasurements->setAttribute(Qt::WA_DeleteOnClose); connect(dialogFMeasurements.data(), &DialogFinalMeasurements::finished, this, [this](int result) { if (result == QDialog::Accepted) { doc->SetFinalMeasurements(dialogFMeasurements->FinalMeasurements()); } - delete dialogFMeasurements; + dialogFMeasurements->close(); }); dialogFMeasurements->show(); }