Only create the editor theme once

This prevents the editor theme from being created twice.
This speeds up the project editor and editor startup
significantly; startup is now 1.3 times faster on average
(tested on a debug build). RAM usage was also lowered by 7.5 MB
on average.

This partially addresses #35321.
This commit is contained in:
Hugo Locurcio
2020-01-19 19:41:01 +01:00
parent 90a224c6eb
commit d72f5e0938
3 changed files with 3 additions and 10 deletions

View File

@ -1218,7 +1218,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
Ref<Theme> create_custom_theme(const Ref<Theme> p_theme) {
Ref<Theme> theme;
String custom_theme = EditorSettings::get_singleton()->get("interface/theme/custom_theme");
const String custom_theme = EditorSettings::get_singleton()->get("interface/theme/custom_theme");
if (custom_theme != "") {
theme = ResourceLoader::load(custom_theme);
}