diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 8ae19a4b5..c81bcd3ac 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -1184,6 +1184,22 @@ void MainWindow::SyncMeasurements() void MainWindow::ToolBarOption() { ui->toolBarOption->clear(); + if (mouseCoordinate != nullptr) + { + delete mouseCoordinate; + mouseCoordinate = nullptr; + } + if (gradationHeights != nullptr) + { + delete gradationHeights; + gradationHeights = nullptr; + } + if (gradationSizes != nullptr) + { + delete gradationSizes; + gradationSizes = nullptr; + } + if (qApp->patternType() == MeasurementsType::Standard) { const QStringList listHeights = VMeasurement::ListHeights(doc->GetGradationHeights(), qApp->patternUnit());