From 6083e3eb019c02f62667468e3ee140341748f149 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 13 Aug 2022 23:55:58 +0100 Subject: [PATCH] Corrected bug with corrupt memory access causing Qt error and seg fault --- src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp index 6b3990c2..f02c35bc 100644 --- a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp @@ -303,7 +303,9 @@ namespace Bloom } void InsightWindow::closeEvent(QCloseEvent* event) { - this->deactivate(); + if (this->activated) { + this->deactivate(); + } return QMainWindow::closeEvent(event); } @@ -684,6 +686,8 @@ namespace Bloom if (this->targetRegistersSidePane != nullptr) { this->targetRegistersSidePane->deactivate(); this->targetRegistersSidePane->deleteLater(); + this->targetRegistersSidePane = nullptr; + this->leftPanel->setVisible(false); this->targetRegistersButton->setChecked(false); this->targetRegistersButton->setDisabled(true);