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) :
lastScr_ = startScreen;
connect(windowHandle(), &QWindow::activeChanged,
activeChangedConnection_ = connect(windowHandle(), &QWindow::activeChanged,
[this]() {
if (!qApp)
return;
auto screenNumber = qApp->desktop()->screenNumber();
QScreen* screen = qApp->screens().at(screenNumber);
windowHandle()->setScreen(nullptr);
......@@ -293,6 +291,7 @@ MainWindow::closeEvent(QCloseEvent* event)
settings.setValue(SettingsKey::windowState, saveState());
}
this->disconnect(screenChangedConnection_);
this->disconnect(activeChangedConnection_);
LRCInstance::reset();
QMainWindow::closeEvent(event);
}
......
......@@ -85,4 +85,5 @@ private:
Ui::MainWindow* ui;
QNetworkConfigurationManager netManager_;
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