Cabana: fix segfault on exit (#26193)

fix segfault on exit
old-commit-hash: d75cbf2338
taco
Dean Lee 3 years ago committed by GitHub
parent 8048aa1177
commit 2aaefc5744
  1. 3
      tools/cabana/mainwin.cc

@ -10,7 +10,7 @@
static MainWindow *main_win = nullptr; static MainWindow *main_win = nullptr;
void qLogMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) { void qLogMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) {
main_win->showStatusMessage(msg); if (main_win) main_win->showStatusMessage(msg);
} }
MainWindow::MainWindow() : QWidget() { MainWindow::MainWindow() : QWidget() {
@ -118,6 +118,7 @@ void MainWindow::dockCharts(bool dock) {
} }
void MainWindow::closeEvent(QCloseEvent *event) { void MainWindow::closeEvent(QCloseEvent *event) {
main_win = nullptr;
if (floating_window) if (floating_window)
floating_window->deleteLater(); floating_window->deleteLater();
QWidget::closeEvent(event); QWidget::closeEvent(event);

Loading…
Cancel
Save