Selaa lähdekoodia

EditorResourcePreview: Let loads complete after exit requested

Pedro J. Estébanez 1 vuosi sitten
vanhempi
commit
f31867d2b9
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      editor/editor_resource_preview.cpp

+ 3 - 1
editor/editor_resource_preview.cpp

@@ -533,8 +533,10 @@ void EditorResourcePreview::stop() {
 			}
 
 			while (!exited.is_set()) {
+				// Sync pending work.
 				OS::get_singleton()->delay_usec(10000);
-				RenderingServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on rendering server
+				RenderingServer::get_singleton()->sync();
+				MessageQueue::get_singleton()->flush();
 			}
 
 			thread.wait_to_finish();