]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a potential use-after-free in ATC code
authorJames Turner <zakalawe@mac.com>
Mon, 11 Jan 2016 19:01:05 +0000 (13:01 -0600)
committerJames Turner <zakalawe@mac.com>
Tue, 12 Jan 2016 18:22:23 +0000 (12:22 -0600)
- 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.

src/ATC/trafficcontrol.cxx

index 0da90a6a882270232311a13aa04c4a3a5168536b..4160595294759491d8b8f210ced0ec97d3300651 100644 (file)
@@ -190,6 +190,9 @@ FGTrafficRecord::FGTrafficRecord():
 
 FGTrafficRecord::~FGTrafficRecord()
 {
+    if (aircraft) {
+        aircraft->clearATCController();
+    }
 }
 
 void FGTrafficRecord::setPositionAndIntentions(int pos,