| 3742 | } |
| 3743 | |
| 3744 | void EditorNode::_exit_editor(int p_exit_code) { |
| 3745 | exiting = true; |
| 3746 | waiting_for_first_scan = false; |
| 3747 | resource_preview->stop(); // Stop early to avoid crashes. |
| 3748 | _save_editor_layout(); |
| 3749 | |
| 3750 | // Dim the editor window while it's quitting to make it clearer that it's busy. |
| 3751 | dim_editor(true); |
| 3752 | |
| 3753 | // Unload addons before quitting to allow cleanup. |
| 3754 | unload_editor_addons(); |
| 3755 | |
| 3756 | get_tree()->quit(p_exit_code); |
| 3757 | } |
| 3758 | |
| 3759 | void EditorNode::unload_editor_addons() { |
| 3760 | for (const KeyValue<String, EditorPlugin *> &E : addon_name_to_plugin) { |