diff options
author | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2017-08-08 23:17:11 +0300 |
---|---|---|
committer | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2017-08-08 23:17:11 +0300 |
commit | fe1c3349e56c944abd3cc90c21ebc0b5ec95961b (patch) | |
tree | bd63fe5d4aaa9fb8651a07d941adb6384a92712b /servers/physics_2d | |
parent | 1939e83a653b3263eeac820a9e36d751a314068b (diff) |
Fix freeze on close of game using 2D physics introduced by #9832
Additionally, port the fix to 3D physics, just in case
Diffstat (limited to 'servers/physics_2d')
-rw-r--r-- | servers/physics_2d/physics_2d_server_sw.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp index debd38d43a..c698d614b8 100644 --- a/servers/physics_2d/physics_2d_server_sw.cpp +++ b/servers/physics_2d/physics_2d_server_sw.cpp @@ -548,8 +548,8 @@ void Physics2DServerSW::body_set_space(RID p_body, RID p_space) { if (body->get_space() == space) return; //pointless - while (body->get_constraint_map().size()) { - RID self = body->get_constraint_map().front()->key()->get_self(); + for (Map<Constraint2DSW *, int>::Element *E = body->get_constraint_map().front(); E; E = E->next()) { + RID self = E->key()->get_self(); if (!self.is_valid()) continue; free(self); |