Don't free METAR objects, it makes NoaaMetarGetRequest::onDone crash
This commit is contained in:
parent
14405fe2e3
commit
235693c1c4
1 changed files with 4 additions and 3 deletions
|
@ -346,9 +346,10 @@ void BasicRealWxController::removeMetarAtPath(const string &propPath)
|
||||||
MetarPropertiesList::iterator it = findMetarAtPath( propPath );
|
MetarPropertiesList::iterator it = findMetarAtPath( propPath );
|
||||||
if( it != _metarProperties.end() ) {
|
if( it != _metarProperties.end() ) {
|
||||||
SG_LOG(SG_ENVIRONMENT, SG_INFO, "removing metar properties at " << propPath);
|
SG_LOG(SG_ENVIRONMENT, SG_INFO, "removing metar properties at " << propPath);
|
||||||
LiveMetarProperties_ptr p(*it);
|
LiveMetarProperties_ptr p(*it); // delay deletion until this goes out of scope when we return; no longer needed?
|
||||||
_metarProperties.erase(it);
|
// TODO: this doesn't actually delete it, because doing so invalidates the
|
||||||
// final ref will drop, and delete the MetarProperties, when we return
|
// BasicRealWxController::update iterator, causing a crash on Go To Airport
|
||||||
|
// _metarProperties.erase(it);
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_ENVIRONMENT, SG_WARN, "no metar properties at " << propPath);
|
SG_LOG(SG_ENVIRONMENT, SG_WARN, "no metar properties at " << propPath);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue