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

Fix editor locked by generating preview of dynamic font
This commit is contained in:
Rémi Verschelde 2020-11-30 17:21:52 +01:00 committed by GitHub
commit 037a6c5b57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {
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;
if (res->is_class("DynamicFont")) {
sampled_font = res->duplicate();