|
|
@ -636,11 +636,15 @@ void MainWindow::closeEvent(QCloseEvent *event) |
|
|
|
QMessageBox::Cancel); |
|
|
|
QMessageBox::Cancel); |
|
|
|
if (button == QMessageBox::Yes) { |
|
|
|
if (button == QMessageBox::Yes) { |
|
|
|
LinkManager::instance()->disconnectAll(); |
|
|
|
LinkManager::instance()->disconnectAll(); |
|
|
|
} else { |
|
|
|
// The above disconnect causes a flurry of activity as the vehicle components are removed. This in turn
|
|
|
|
|
|
|
|
// causes the Windows Version of Qt to crash if you allow the close event to be accepted. In order to prevent
|
|
|
|
|
|
|
|
// the crash, we ignore the close event and setup a delayed timer to close the window after things settle down.
|
|
|
|
|
|
|
|
QTimer::singleShot(1500, this, &MainWindow::_closeWindow); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
event->ignore(); |
|
|
|
event->ignore(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// This will process any remaining flight log save dialogs
|
|
|
|
// This will process any remaining flight log save dialogs
|
|
|
|
qgcApp()->processEvents(QEventLoop::ExcludeUserInputEvents); |
|
|
|
qgcApp()->processEvents(QEventLoop::ExcludeUserInputEvents); |
|
|
|