Browse Source

Fix leak when closing theme editor preview tabs

(cherry picked from commit 5e3229b7ed1c9a1a0eeb9db5b0e8b2fc9a8d438d)
Yuri Sizov 1 year ago
parent
commit
d5fab0ec4c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      editor/plugins/theme_editor_plugin.cpp

+ 2 - 0
editor/plugins/theme_editor_plugin.cpp

@@ -3582,6 +3582,8 @@ void ThemeEditor::_remove_preview_tab(int p_tab) {
 		}
 		}
 
 
 		preview_tabs_content->remove_child(preview_tab);
 		preview_tabs_content->remove_child(preview_tab);
+		preview_tab->queue_free();
+
 		preview_tabs->remove_tab(p_tab);
 		preview_tabs->remove_tab(p_tab);
 		_change_preview_tab(preview_tabs->get_current_tab());
 		_change_preview_tab(preview_tabs->get_current_tab());
 	}
 	}