diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-10-07 11:51:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-07 11:51:11 +0200 |
commit | 22f2b275286b859a6c23e179939a7a7c48e8c894 (patch) | |
tree | ac5c32b9fb98c9ec7462a893f64ebe7c4c9d15ed | |
parent | 0647d9dc7dfbd3d4323763ef560d834dc9d403f6 (diff) | |
parent | 6072f38bb1d70e27a08cb38f329da86731b89c36 (diff) |
Merge pull request #53505 from timothyqiu/stack-overflow
-rw-r--r-- | scene/3d/proximity_group_3d.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/scene/3d/proximity_group_3d.cpp b/scene/3d/proximity_group_3d.cpp index c8c61a9f00..23df00c1f6 100644 --- a/scene/3d/proximity_group_3d.cpp +++ b/scene/3d/proximity_group_3d.cpp @@ -34,9 +34,9 @@ void ProximityGroup3D::_clear_groups() { Map<StringName, uint32_t>::Element *E; + const int size = 16; - { - const int size = 16; + do { StringName remove_list[size]; E = groups.front(); int num = 0; @@ -50,11 +50,7 @@ void ProximityGroup3D::_clear_groups() { for (int i = 0; i < num; i++) { groups.erase(remove_list[i]); } - } - - if (E) { - _clear_groups(); // call until we go through the whole list - } + } while (E); } void ProximityGroup3D::_update_groups() { |