Fred found some iterated related problems. With a bit of luck this solves the segmentation fault problem.
This commit is contained in:
parent
009fa7371d
commit
eb0b1492a2
1 changed files with 7 additions and 2 deletions
|
@ -147,9 +147,14 @@ void FGAIManager::update(double dt) {
|
||||||
if ((*ai_list_itr)->getDie()) {
|
if ((*ai_list_itr)->getDie()) {
|
||||||
freeID((*ai_list_itr)->getID());
|
freeID((*ai_list_itr)->getID());
|
||||||
delete (*ai_list_itr);
|
delete (*ai_list_itr);
|
||||||
ai_list.erase(ai_list_itr);
|
|
||||||
--ai_list_itr;
|
|
||||||
--numObjects;
|
--numObjects;
|
||||||
|
if ( ai_list_itr == ai_list.begin() ) {
|
||||||
|
ai_list.erase(ai_list_itr);
|
||||||
|
ai_list_itr = ai_list.begin();
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
ai_list.erase(ai_list_itr--);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fetchUserState();
|
fetchUserState();
|
||||||
if ((*ai_list_itr)->isa(FGAIBase::otThermal)) {
|
if ((*ai_list_itr)->isa(FGAIBase::otThermal)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue