Commit 09818685 authored by Don Gagne's avatar Don Gagne

DeleteOnClose causes strange Qt bug

When using DeleteOnClose with a QQuickWidget, the shutdown sequence
causes the MainWindow destructor loop back onto itself.
parent 558b23f8
......@@ -456,6 +456,10 @@ void QGCApplication::_createSingletons(void)
void QGCApplication::_destroySingletons(void)
{
if (MainWindow::instance()) {
delete MainWindow::instance();
}
if (LinkManager::instance(true /* nullOk */)) {
// This will close/delete all connections
LinkManager::instance()->_shutdown();
......
......@@ -127,7 +127,6 @@ MainWindow::MainWindow(QSplashScreen* splashScreen, enum MainWindow::CUSTOM_MODE
connect(this, &MainWindow::initStatusChanged, splashScreen, &QSplashScreen::showMessage);
}
this->setAttribute(Qt::WA_DeleteOnClose);
connect(menuActionHelper, SIGNAL(needToShowDockWidget(QString,bool)),SLOT(showDockWidget(QString,bool)));
connect(MAVLinkProtocol::instance(), SIGNAL(protocolStatusMessage(const QString&, const QString&)), this, SLOT(showCriticalMessage(const QString&, const QString&)));
......@@ -524,7 +523,7 @@ void MainWindow::buildCommonWidgets()
{
setupView = new SubMainWindow(this);
setupView->setObjectName("VIEW_SETUP");
setupView->setCentralWidget(new SetupView(this));
setupView->setCentralWidget((QWidget*)new SetupView(this));
addToCentralStackedWidget(setupView, VIEW_SETUP, "Setup");
}
if (!engineeringView)
......
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