From a5370b1b1bed3744941c90b4a05d4516aabd4c67 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 27 Feb 2019 13:31:11 -0300 Subject: -Fix problem of order of import plugins, closes #26340 -Ensure resource previewer does not start until first import is done --- editor/editor_resource_preview.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'editor/editor_resource_preview.cpp') diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 1fa1fe9070..e0c292dc87 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -417,6 +417,10 @@ void EditorResourcePreview::check_for_invalidation(const String &p_path) { } } +void EditorResourcePreview::start() { + ERR_FAIL_COND(thread); + thread = Thread::create(_thread_func, this); +} void EditorResourcePreview::stop() { if (thread) { exit = true; @@ -428,13 +432,12 @@ void EditorResourcePreview::stop() { } EditorResourcePreview::EditorResourcePreview() { + thread = NULL; singleton = this; preview_mutex = Mutex::create(); preview_sem = Semaphore::create(); order = 0; exit = false; - - thread = Thread::create(_thread_func, this); } EditorResourcePreview::~EditorResourcePreview() { -- cgit v1.2.3