1
0
Fork 0

Better robustness for the ATCData structure istream operator. Adding fin.close() seems to have cured an intermittent stackdump when reading in the voice files which are the next istream operation to occur. Unknown types no longer cause the rest of the file not to be read - only the specific unknown entry

This commit is contained in:
daveluff 2003-02-13 12:17:37 +00:00
parent f57e495893
commit b271bc5da2

View file

@ -86,23 +86,25 @@ bool FGCommList::LoadComms(SGPath path) {
ATCData a; ATCData a;
fin >> a; fin >> a;
if(a.type == INVALID) { if(a.type == INVALID) {
break; cout << "WARNING - INVALID type found in " << path.str() << '\n';
} } else {
// Push all stations onto frequency map
commlist_freq[a.freq].push_back(a);
// Push all stations onto frequency map // Push approach stations onto bucket map as well
commlist_freq[a.freq].push_back(a); if(a.type == APPROACH) {
// get bucket number
// Push approach stations onto bucket map as well SGBucket bucket(a.lon, a.lat);
if(a.type == APPROACH) { int bucknum = bucket.gen_index();
// get bucket number commlist_bck[bucknum].push_back(a);
SGBucket bucket(a.lon, a.lat); }
int bucknum = bucket.gen_index();
commlist_bck[bucknum].push_back(a);
} }
fin >> skipcomment; fin >> skipcomment;
} }
return true;
fin.close();
return true;
} }