Commit ed6d4bd4 authored by Stefan Dunca's avatar Stefan Dunca

Fix dangling pointer access

parent e706b4c4
......@@ -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();
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