Parcourir la source

Merge pull request #26279 from ericrybick/master

Fix Editor crash after disabling plugin that used "forward_spatial_gui_input" #26124
Rémi Verschelde il y a 6 ans
Parent
commit
8930347c48
2 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 5 0
      editor/editor_node.cpp
  2. 1 0
      editor/editor_node.h

+ 5 - 0
editor/editor_node.cpp

@@ -2542,6 +2542,7 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor, bool p_config_chan
 	singleton->editor_plugins_over->get_plugins_list().erase(p_editor);
 	singleton->editor_plugins_over->get_plugins_list().erase(p_editor);
 	singleton->remove_child(p_editor);
 	singleton->remove_child(p_editor);
 	singleton->editor_data.remove_editor_plugin(p_editor);
 	singleton->editor_data.remove_editor_plugin(p_editor);
+	singleton->get_editor_plugins_force_input_forwarding()->remove_plugin(p_editor);
 }
 }
 
 
 void EditorNode::_update_addon_config() {
 void EditorNode::_update_addon_config() {
@@ -6059,6 +6060,10 @@ void EditorPluginList::add_plugin(EditorPlugin *p_plugin) {
 	plugins_list.push_back(p_plugin);
 	plugins_list.push_back(p_plugin);
 }
 }
 
 
+void EditorPluginList::remove_plugin(EditorPlugin *p_plugin) {
+	plugins_list.erase(p_plugin);
+}
+
 bool EditorPluginList::empty() {
 bool EditorPluginList::empty() {
 	return plugins_list.empty();
 	return plugins_list.empty();
 }
 }

+ 1 - 0
editor/editor_node.h

@@ -837,6 +837,7 @@ public:
 	void forward_spatial_draw_over_viewport(Control *p_overlay);
 	void forward_spatial_draw_over_viewport(Control *p_overlay);
 	void forward_spatial_force_draw_over_viewport(Control *p_overlay);
 	void forward_spatial_force_draw_over_viewport(Control *p_overlay);
 	void add_plugin(EditorPlugin *p_plugin);
 	void add_plugin(EditorPlugin *p_plugin);
+	void remove_plugin(EditorPlugin *p_plugin);
 	void clear();
 	void clear();
 	bool empty();
 	bool empty();