Cabana: fix segfault on exit (#26193)

fix segfault on exit
pull/26186/head^2
Dean Lee 3 years ago committed by GitHub
parent 22c5be5ec1
commit d75cbf2338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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