Commit 03046850 authored by Andreas Traczyk's avatar Andreas Traczyk

mainwindow: disconnect from active changed signal before exit

Change-Id: Ib671e20016a2372ac2abbac7060b44ac0d1b90c4
parent 10523bf3
...@@ -150,10 +150,8 @@ MainWindow::MainWindow(QWidget* parent) : ...@@ -150,10 +150,8 @@ MainWindow::MainWindow(QWidget* parent) :
lastScr_ = startScreen; lastScr_ = startScreen;
connect(windowHandle(), &QWindow::activeChanged, activeChangedConnection_ = connect(windowHandle(), &QWindow::activeChanged,
[this]() { [this]() {
if (!qApp)
return;
auto screenNumber = qApp->desktop()->screenNumber(); auto screenNumber = qApp->desktop()->screenNumber();
QScreen* screen = qApp->screens().at(screenNumber); QScreen* screen = qApp->screens().at(screenNumber);
windowHandle()->setScreen(nullptr); windowHandle()->setScreen(nullptr);
...@@ -293,6 +291,7 @@ MainWindow::closeEvent(QCloseEvent* event) ...@@ -293,6 +291,7 @@ MainWindow::closeEvent(QCloseEvent* event)
settings.setValue(SettingsKey::windowState, saveState()); settings.setValue(SettingsKey::windowState, saveState());
} }
this->disconnect(screenChangedConnection_); this->disconnect(screenChangedConnection_);
this->disconnect(activeChangedConnection_);
LRCInstance::reset(); LRCInstance::reset();
QMainWindow::closeEvent(event); QMainWindow::closeEvent(event);
} }
......
...@@ -85,4 +85,5 @@ private: ...@@ -85,4 +85,5 @@ private:
Ui::MainWindow* ui; Ui::MainWindow* ui;
QNetworkConfigurationManager netManager_; QNetworkConfigurationManager netManager_;
QMetaObject::Connection screenChangedConnection_; QMetaObject::Connection screenChangedConnection_;
QMetaObject::Connection activeChangedConnection_;
}; };
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment