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:
parent
f57e495893
commit
b271bc5da2
1 changed files with 17 additions and 15 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue