Explorar o código

Make sure that the resource previewer does not hang on exit

Hein-Pieter van Braam-Stewart %!s(int64=6) %!d(string=hai) anos
pai
achega
d1dbbd6515
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      editor/editor_resource_preview.cpp

+ 2 - 1
editor/editor_resource_preview.cpp

@@ -218,6 +218,7 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &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;