From: James Turner Date: Mon, 16 Aug 2010 16:10:12 +0000 (+0100) Subject: Fix crashes (activating the route-manager) with a default GPS. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ae50c054a9007b98f1a8dafe6d589d0b4cab8873;p=flightgear.git Fix crashes (activating the route-manager) with a default GPS. --- diff --git a/src/Instrumentation/gps.cxx b/src/Instrumentation/gps.cxx index 9ebe8d6ea..71e3becbd 100644 --- a/src/Instrumentation/gps.cxx +++ b/src/Instrumentation/gps.cxx @@ -332,7 +332,7 @@ GPS::bind() tie(_gpsNode, "desired-course-deg", SGRawValueMethods (*this, &GPS::getDesiredCourse, NULL)); - _desiredCourseNode = _gpsNode->getChild("desired-course-deg"); + _desiredCourseNode = _gpsNode->getChild("desired-course-deg", 0, true); tieSGGeodReadOnly(_gpsNode, _indicated_pos, "indicated-longitude-deg", "indicated-latitude-deg", "indicated-altitude-ft"); diff --git a/src/Instrumentation/instrument_mgr.cxx b/src/Instrumentation/instrument_mgr.cxx index b85f191ae..2e3f21e3f 100644 --- a/src/Instrumentation/instrument_mgr.cxx +++ b/src/Instrumentation/instrument_mgr.cxx @@ -92,6 +92,7 @@ void FGInstrumentMgr::init() SGPropertyNode_ptr nd(new SGPropertyNode); nd->setStringValue("name", "gps"); nd->setIntValue("number", 0); + _instruments.push_back("gps[0]"); set_subsystem("gps[0]", new GPS(nd)); }