]> git.mxchange.org Git - flightgear.git/commitdiff
Don't free METAR objects, it makes NoaaMetarGetRequest::onDone crash
authorRebecca N. Palmer <rebecca_palmer@zoho.com>
Sat, 4 Apr 2015 13:32:58 +0000 (14:32 +0100)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Sat, 4 Apr 2015 13:32:58 +0000 (14:32 +0100)
src/Environment/realwx_ctrl.cxx

index 995a148ab95905aa26d92a3e0c773c25a1ebe14a..ac89e286231122da600745e443531959ce514cf2 100644 (file)
@@ -346,9 +346,10 @@ void BasicRealWxController::removeMetarAtPath(const string &propPath)
   MetarPropertiesList::iterator it = findMetarAtPath( propPath );
   if( it != _metarProperties.end() ) {
     SG_LOG(SG_ENVIRONMENT, SG_INFO, "removing metar properties at " << propPath);
-    LiveMetarProperties_ptr p(*it);
-    _metarProperties.erase(it);
-    // final ref will drop, and delete the MetarProperties, when we return
+    LiveMetarProperties_ptr p(*it); // delay deletion until this goes out of scope when we return; no longer needed?
+    // TODO: this doesn't actually delete it, because doing so invalidates the
+    // BasicRealWxController::update iterator, causing a crash on Go To Airport
+    // _metarProperties.erase(it);
   } else {
     SG_LOG(SG_ENVIRONMENT, SG_WARN, "no metar properties at " << propPath);
   }