浏览代码

Fix crash when disabling main screen plugin

(cherry picked from commit 0ec2b7baea235c3c5cf43ab296b40c06982b32de)
George Marques 9 年之前
父节点
当前提交
63b5a80088
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      tools/editor/editor_node.cpp

+ 4 - 0
tools/editor/editor_node.cpp

@@ -3015,6 +3015,10 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor) {
 
 			if (p_editor->get_name()==singleton->main_editor_buttons[i]->get_text()) {
 
+				if (singleton->main_editor_buttons[i]->is_pressed()) {
+					singleton->_editor_select(EDITOR_SCRIPT);
+				}
+
 				memdelete( singleton->main_editor_buttons[i] );
 				singleton->main_editor_buttons.remove(i);