mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
collision handler pointer may have already been removed
This commit is contained in:
parent
cf5188d6ba
commit
c683d3d834
@ -142,11 +142,14 @@ remove_collider(CollisionNode *node) {
|
|||||||
|
|
||||||
// Update the set of handlers.
|
// Update the set of handlers.
|
||||||
Handlers::iterator hi = _handlers.find(handler);
|
Handlers::iterator hi = _handlers.find(handler);
|
||||||
nassertr(hi != _handlers.end(), false);
|
// It's possible that the handler doesn't exist in the list (it may
|
||||||
(*hi).second--;
|
// have removed itself if it detected some internal error).
|
||||||
nassertr((*hi).second >= 0, false);
|
if (hi != _handlers.end()) {
|
||||||
if ((*hi).second == 0) {
|
(*hi).second--;
|
||||||
_handlers.erase(hi);
|
nassertr((*hi).second >= 0, false);
|
||||||
|
if ((*hi).second == 0) {
|
||||||
|
_handlers.erase(hi);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_colliders.erase(ci);
|
_colliders.erase(ci);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user