diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-05-25 16:01:57 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-05-25 17:45:13 -0700 |
commit | adb61b38eae5b7e6522edbde1ff5e088c0dd6cb7 (patch) | |
tree | a30836bd84c9f88c698389cd3d11ca2e409db1d6 | |
parent | f17f4ec9a0e9a3cb92b651fc38fc0aa6802f74bc (diff) | |
download | subsurface-adb61b38eae5b7e6522edbde1ff5e088c0dd6cb7.tar.gz |
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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/divelogexportdialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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())); |