Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API hash related crash in EditorSettings #80089

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions editor/doc_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@ void DocTools::generate(bool p_basic_types) {
default_value_valid = true;
}
}
} else if (name == "EditorSettings") {
// Special case for editor settings, to prevent hardware or OS specific settings to affect the result.
} else if (import_option) {
default_value = import_options_default[E.name];
default_value_valid = true;
Expand Down
1 change: 0 additions & 1 deletion editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6822,7 +6822,6 @@ EditorNode::EditorNode() {
// No scripting by default if in editor.
ScriptServer::set_scripting_enabled(false);

EditorSettings::ensure_class_registered();
EditorHelp::generate_doc();
SceneState::set_disable_placeholders(true);
ResourceLoader::clear_translation_remaps(); // Using no remaps if in editor.
Expand Down
9 changes: 0 additions & 9 deletions editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,13 +878,6 @@ EditorSettings *EditorSettings::get_singleton() {
return singleton.ptr();
}

void EditorSettings::ensure_class_registered() {
ClassDB::APIType prev_api = ClassDB::get_current_api();
ClassDB::set_current_api(ClassDB::API_EDITOR);
GDREGISTER_CLASS(EditorSettings); // Otherwise it can't be unserialized.
ClassDB::set_current_api(prev_api);
}

void EditorSettings::create() {
// IMPORTANT: create() *must* create a valid EditorSettings singleton,
// as the rest of the engine code will assume it. As such, it should never
Expand All @@ -895,8 +888,6 @@ void EditorSettings::create() {
return;
}

ensure_class_registered();

String config_file_path;
Ref<ConfigFile> extra_config = memnew(ConfigFile);

Expand Down
1 change: 0 additions & 1 deletion editor/editor_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ class EditorSettings : public Resource {

static EditorSettings *get_singleton();

static void ensure_class_registered();
static void create();
void setup_language();
void setup_network();
Expand Down
2 changes: 1 addition & 1 deletion editor/register_editor_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void register_editor_types() {
GDREGISTER_CLASS(EditorScript);
GDREGISTER_CLASS(EditorSelection);
GDREGISTER_CLASS(EditorFileDialog);
GDREGISTER_ABSTRACT_CLASS(EditorSettings);
GDREGISTER_CLASS(EditorSettings);
GDREGISTER_CLASS(EditorNode3DGizmo);
GDREGISTER_CLASS(EditorNode3DGizmoPlugin);
GDREGISTER_ABSTRACT_CLASS(EditorResourcePreview);
Expand Down