Sfoglia il codice sorgente

Fix crash when disabling main screen plugin

George Marques 9 anni fa
parent
commit
0ec2b7baea
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      tools/editor/editor_node.cpp

+ 4 - 0
tools/editor/editor_node.cpp

@@ -3018,6 +3018,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);