If a fixture gets destroyed, when it was touching another one, b2ContactListener::EndContact gets called. Also the manual states so.
On EndContact I need to access user data stored within the fixture, but cannot, since such function can be called even on fixtures which are being destroied (and that have invalid user data bound to them).
How am I supposed to know if one (or both) of the fixtures passed to b2ContactListener::EndContact is being destroyed?
Quote:
End Contact Event
This is called when two fixtures cease to overlap. This is called for sensors and non-sensors. This may be called when a body is destroyed, so this event can occur outside the time step.
This is called when two fixtures cease to overlap. This is called for sensors and non-sensors. This may be called when a body is destroyed, so this event can occur outside the time step.
On EndContact I need to access user data stored within the fixture, but cannot, since such function can be called even on fixtures which are being destroied (and that have invalid user data bound to them).
How am I supposed to know if one (or both) of the fixtures passed to b2ContactListener::EndContact is being destroyed?