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,9 +86,8 @@ bool FGCommList::LoadComms(SGPath path) {
ATCData a;
fin >> a;
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);
@ -99,9 +98,12 @@ bool FGCommList::LoadComms(SGPath path) {
int bucknum = bucket.gen_index();
commlist_bck[bucknum].push_back(a);
}
}
fin >> skipcomment;
}
fin.close();
return true;
}