From: James Turner Date: Mon, 11 Jan 2016 19:01:05 +0000 (-0600) Subject: Fix a potential use-after-free in ATC code X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a972df05dc643f4c944127596da403d23df7b876;p=flightgear.git Fix a potential use-after-free in ATC code - when dynamics shuts down the ATC controllers, they clear their traffic vectors (destroying the records), but we didn’t notify the AI aircraft of this. Ensure the controller is cleared so the AI aircraft shutdown doesn’t crash. --- diff --git a/src/ATC/trafficcontrol.cxx b/src/ATC/trafficcontrol.cxx index 0da90a6a8..416059529 100644 --- a/src/ATC/trafficcontrol.cxx +++ b/src/ATC/trafficcontrol.cxx @@ -190,6 +190,9 @@ FGTrafficRecord::FGTrafficRecord(): FGTrafficRecord::~FGTrafficRecord() { + if (aircraft) { + aircraft->clearATCController(); + } } void FGTrafficRecord::setPositionAndIntentions(int pos,