diff options
author | hop311 <hop3114@gmail.com> | 2024-07-26 22:59:12 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-07-26 22:59:12 +0200 |
commit | 164db4eb8f24e87755e02bae0e539f4f266e15b9 (patch) | |
tree | 9ab24e79d47c2c56dfd68ebf89e419d30324c92c /extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp | |
parent | 46c3009075be36577ab7dbea263655e428833b20 (diff) |
Free removed child nodes + `godot::` cleanupfree-on-remove
Diffstat (limited to 'extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp')
-rw-r--r-- | extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp b/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp index 921f633..fe1f941 100644 --- a/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp +++ b/extension/src/openvic-extension/classes/GUIOverlappingElementsBox.cpp @@ -96,7 +96,9 @@ Error GUIOverlappingElementsBox::set_child_count(int32_t new_count) { return OK; } else if (child_count > new_count) { do { - remove_child(get_child(--child_count)); + Node* child = get_child(--child_count); + remove_child(child); + child->queue_free(); } while (child_count > new_count); return OK; } else { |