Browse Source

Merge pull request #53505 from timothyqiu/stack-overflow

Rémi Verschelde 3 năm trước cách đây
mục cha
commit
22f2b27528
1 tập tin đã thay đổi với 3 bổ sung7 xóa
  1. 3 7
      scene/3d/proximity_group_3d.cpp

+ 3 - 7
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() {