Unverified Commit 885656cb authored by Gus Grubba's avatar Gus Grubba Committed by GitHub

Merge pull request #7555 from stefandunca/pr-fix_segfault

Fix dangling pointer access
parents e706b4c4 ed6d4bd4
......@@ -551,8 +551,11 @@ Vehicle::~Vehicle()
void Vehicle::prepareDelete()
{
if(_cameras) {
delete _cameras;
// because of _cameras QML bindings check for nullptr won't work in the binding pipeline
// the dangling pointer access will cause a runtime fault
auto tmpCameras = _cameras;
_cameras = nullptr;
delete tmpCameras;
emit dynamicCamerasChanged();
qApp->processEvents();
}
......
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