mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -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.
|
||||
Handlers::iterator hi = _handlers.find(handler);
|
||||
nassertr(hi != _handlers.end(), false);
|
||||
(*hi).second--;
|
||||
nassertr((*hi).second >= 0, false);
|
||||
if ((*hi).second == 0) {
|
||||
_handlers.erase(hi);
|
||||
// It's possible that the handler doesn't exist in the list (it may
|
||||
// have removed itself if it detected some internal error).
|
||||
if (hi != _handlers.end()) {
|
||||
(*hi).second--;
|
||||
nassertr((*hi).second >= 0, false);
|
||||
if ((*hi).second == 0) {
|
||||
_handlers.erase(hi);
|
||||
}
|
||||
}
|
||||
|
||||
_colliders.erase(ci);
|
||||
|
Loading…
x
Reference in New Issue
Block a user