diff options
Diffstat (limited to 'editor/editor_resource_preview.cpp')
-rw-r--r-- | editor/editor_resource_preview.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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() { |