]> git.mxchange.org Git - flightgear.git/blobdiff - src/Navaids/markerbeacon.cxx
Fix some leaks on reset
[flightgear.git] / src / Navaids / markerbeacon.cxx
index 769eda40a0d6399632539f96b31586104a0708c9..82726e8e1042293411872f536189f17960a7ff51 100644 (file)
@@ -25,6 +25,8 @@
 #endif
 
 #include <Navaids/markerbeacon.hxx>
+#include <Airports/runways.hxx>
+#include <Navaids/NavDataCache.hxx>
 
 using std::string;
 
@@ -34,3 +36,10 @@ FGMarkerBeaconRecord::FGMarkerBeaconRecord(PositionedID aGuid, Type aTy,
   _runway(aRunway)
 {
 }
+
+FGRunwayRef FGMarkerBeaconRecord::runway() const
+{
+    FGPositioned* p = flightgear::NavDataCache::instance()->loadById(_runway);
+    assert(p->type() == FGPositioned::RUNWAY);
+    return static_cast<FGRunway*>(p);
+}
\ No newline at end of file