From d2afd00011123f9b0ee6b66b3b726056e32f1e8a Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 1 Jul 2014 00:06:45 +0200 Subject: [PATCH] refs #273, fixes "QObject::disconnect: Unexpected null parameter" --- samples/blackgui/mainwindow.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/samples/blackgui/mainwindow.cpp b/samples/blackgui/mainwindow.cpp index c465fa968..e539bda2f 100644 --- a/samples/blackgui/mainwindow.cpp +++ b/samples/blackgui/mainwindow.cpp @@ -58,9 +58,7 @@ MainWindow::MainWindow(GuiModes::WindowMode windowMode, QWidget *parent) : * Destructor */ MainWindow::~MainWindow() -{ - this->disconnect(this->getIContextSimulator(), &IContextSimulator::connectionChanged, this, &MainWindow::simulatorConnectionChanged); -} +{ } /* * Graceful shutdown @@ -88,7 +86,7 @@ void MainWindow::gracefulShutdown() // if we have a context, we shut some things down if (this->m_contextNetworkAvailable) { - if (this->getIContextNetwork()->isConnected()) + if (this->getIContextNetwork() && this->getIContextNetwork()->isConnected()) { if (this->m_contextAudioAvailable) { @@ -99,6 +97,9 @@ void MainWindow::gracefulShutdown() this->getIContextNetwork()->disconnect(this); // avoid any status update signals, etc. } } + + if (this->getIContextSimulator()) + this->disconnect(this->getIContextSimulator(), &IContextSimulator::connectionChanged, this, &MainWindow::simulatorConnectionChanged); } /*