Cabana: fix segfault on exit (#26193)

fix segfault on exit
old-commit-hash: d75cbf2338f098a9c2143c94a9db8ddce68699b4
This commit is contained in:
Dean Lee
2022-10-22 01:33:13 +08:00
committed by GitHub
parent 8048aa1177
commit 2aaefc5744
+2 -1
View File
@@ -10,7 +10,7 @@
static MainWindow *main_win = nullptr;
void qLogMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) {
main_win->showStatusMessage(msg);
if (main_win) main_win->showStatusMessage(msg);
}
MainWindow::MainWindow() : QWidget() {
@@ -118,6 +118,7 @@ void MainWindow::dockCharts(bool dock) {
}
void MainWindow::closeEvent(QCloseEvent *event) {
main_win = nullptr;
if (floating_window)
floating_window->deleteLater();
QWidget::closeEvent(event);