Skip to content

Commit

Permalink
Merge pull request #93238 from bruvzg/ed_unload_addons
Browse files Browse the repository at this point in the history
[Editor] Unload addons before quitting to allow cleanup.
  • Loading branch information
akien-mga committed Jun 18, 2024
2 parents 39ab252 + d96c58b commit edf2f8c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3324,6 +3324,13 @@ void EditorNode::_exit_editor(int p_exit_code) {
// Dim the editor window while it's quitting to make it clearer that it's busy.
dim_editor(true);

// Unload addons before quitting to allow cleanup.
for (const KeyValue<String, EditorPlugin *> &E : addon_name_to_plugin) {
print_verbose(vformat("Unloading addon: %s", E.key));
remove_editor_plugin(E.value, false);
memdelete(E.value);
}

get_tree()->quit(p_exit_code);
}

Expand Down

0 comments on commit edf2f8c

Please sign in to comment.