Browse Source

Merge pull request #43991 from volzhs/fix-lock-preview-dymanicfont

Fix editor locked by generating preview of dynamic font
Rémi Verschelde 4 years ago
parent
commit
037a6c5b57
1 changed files with 3 additions and 1 deletions
  1. 3 1
      editor/plugins/editor_preview_plugins.cpp

+ 3 - 1
editor/plugins/editor_preview_plugins.cpp

@@ -834,7 +834,9 @@ bool EditorFontPreviewPlugin::handles(const String &p_type) const {
 
 
 Ref<Texture> EditorFontPreviewPlugin::generate_from_path(const String &p_path, const Size2 &p_size) const {
 Ref<Texture> EditorFontPreviewPlugin::generate_from_path(const String &p_path, const Size2 &p_size) const {
 
 
-	RES res = ResourceLoader::load(p_path);
+	Ref<ResourceInteractiveLoader> ril = ResourceLoader::load_interactive(p_path);
+	ril.ptr()->wait();
+	RES res = ril.ptr()->get_resource();
 	Ref<DynamicFont> sampled_font;
 	Ref<DynamicFont> sampled_font;
 	if (res->is_class("DynamicFont")) {
 	if (res->is_class("DynamicFont")) {
 		sampled_font = res->duplicate();
 		sampled_font = res->duplicate();