At first glance, if you're blowing up on a simple get routine, it probably means you're using pointers but you messed up the pointer somewhere and it points to an invalid place. That means regardless of the method you call, it should explode because they're all pointing nowhere.
- adding invalid ones onto the STL list
- breaking the list somewhere
- Incorrectly keeping the number of elements on the list and when you delete some, you're going past the end.
- You're keeping a pointer to something that has been destroyed and then accessing it.
Actually, come to think of it, you shouldn't necessarily need to use pointers AND an STL list. If I recall correctly, you only need pointers AND STL lists when you use inheritance so you can tell whether you're talking to a base class or an inherited version at run-time.
, ALLEGRO_PLAYMODE_ONCE, 0);
cout << "NO BOOM!";
cout << "HE llegado";
20 else if((*
iterBalas, ALTURA_DISPLAY, ANCHURA_DISPLAY))
22 delete (*
It looks like you are deleting the object pointed to by iterEnemigos and iterBalas but immediately after that in the else if, you're dereferencing ("following") the pointer (that you destroyed) to nowhere, and then once at the nowhere you're trying to call methods on it which blow up.
That's not necessarily the GetX seg fault though.