From d1dbbd6515b7710594a406010177aa23e6b766b0 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam-Stewart Date: Thu, 30 May 2019 23:05:44 -0700 Subject: [PATCH] Make sure that the resource previewer does not hang on exit --- editor/editor_resource_preview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 6cca0a0ffad..f2e4d1086b9 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -218,6 +218,7 @@ void EditorResourcePreview::_generate_preview(Ref &r_texture, Ref< void EditorResourcePreview::_thread() { #ifndef SERVER_ENABLED + exited = false; while (!exit) { preview_sem->wait(); @@ -452,8 +453,8 @@ void EditorResourcePreview::check_for_invalidation(const String &p_path) { void EditorResourcePreview::start() { ERR_FAIL_COND(thread); thread = Thread::create(_thread_func, this); - exited = false; } + void EditorResourcePreview::stop() { if (thread) { exit = true;