Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
27a4837c
Commit
27a4837c
authored
Nov 07, 2015
by
dogmaphobic
Browse files
Testing for _mainQmlWidgetHolder before blindly assuming it is valid.
parent
90ecc18d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ui/MainWindow.cc
View file @
27a4837c
...
...
@@ -471,11 +471,17 @@ void MainWindow::closeEvent(QCloseEvent *event)
// We have to pull out the QmlWidget from the main window and delete it here, before
// the MainWindow ends up getting deleted. Otherwise the Qml has a reference to MainWindow
// inside it which in turn causes a shutdown crash.
// Remove image provider
_mainQmlWidgetHolder
->
getEngine
()
->
removeImageProvider
(
QLatin1String
(
"QGCImages"
));
_centralLayout
->
removeWidget
(
_mainQmlWidgetHolder
);
delete
_mainQmlWidgetHolder
;
_mainQmlWidgetHolder
=
NULL
;
//-- Unit test gets here with _mainQmlWidgetHolder being NULL
if
(
_mainQmlWidgetHolder
)
{
// Remove image provider
_mainQmlWidgetHolder
->
getEngine
()
->
removeImageProvider
(
QLatin1String
(
"QGCImages"
));
_centralLayout
->
removeWidget
(
_mainQmlWidgetHolder
);
delete
_mainQmlWidgetHolder
;
_mainQmlWidgetHolder
=
NULL
;
}
_storeCurrentViewState
();
storeSettings
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment