mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix use after free in the editor inspector section cleanup.
This commit is contained in:
parent
3d9b05ad4a
commit
c7ca36b827
1 changed files with 2 additions and 1 deletions
|
|
@ -3941,8 +3941,9 @@ void EditorInspector::update_tree() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up empty sections.
|
// Clean up empty sections.
|
||||||
for (List<EditorInspectorSection *>::Element *I = sections.back(); I; I = I->prev()) {
|
for (List<EditorInspectorSection *>::Element *I = sections.back(); I;) {
|
||||||
EditorInspectorSection *section = I->get();
|
EditorInspectorSection *section = I->get();
|
||||||
|
I = I->prev(); // Note: Advance before erasing element.
|
||||||
if (section->get_vbox()->get_child_count() == 0) {
|
if (section->get_vbox()->get_child_count() == 0) {
|
||||||
sections.erase(section);
|
sections.erase(section);
|
||||||
vbox_per_path[main_vbox].erase(section->get_section());
|
vbox_per_path[main_vbox].erase(section->get_section());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue