From adb61b38eae5b7e6522edbde1ff5e088c0dd6cb7 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 25 May 2015 16:01:57 -0300 Subject: Do not connect null to a signal The parent here should have been the mainwindow, but we create this dialog on the stack instead of the heap and because of that we don't set the parent to prevent a double free. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/divelogexportdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-ui') diff --git a/qt-ui/divelogexportdialog.cpp b/qt-ui/divelogexportdialog.cpp index 12a8c320f..b88ebda70 100644 --- a/qt-ui/divelogexportdialog.cpp +++ b/qt-ui/divelogexportdialog.cpp @@ -24,7 +24,7 @@ DiveLogExportDialog::DiveLogExportDialog(QWidget *parent) : QDialog(parent), ui->setupUi(this); showExplanation(); QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this); - connect(quit, SIGNAL(activated()), parent, SLOT(close())); + connect(quit, SIGNAL(activated()), MainWindow::instance(), SLOT(close())); QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this); connect(close, SIGNAL(activated()), this, SLOT(close())); -- cgit v1.2.3-70-g09d2