Only update the RenderingServer from the Main Thread while in debug break.

This commit is contained in:
Relintai 2023-09-10 22:49:21 +02:00
parent e98b2a954b
commit 840e36c341

View File

@ -377,9 +377,12 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue,
// This is for the camera override to stay live even when the game is paused from the editor
loop_time_sec = (OS::get_singleton()->get_ticks_usec() - loop_begin_usec) / 1000000.0f;
RenderingServer::get_singleton()->sync();
if (RenderingServer::get_singleton()->has_changed()) {
RenderingServer::get_singleton()->draw(true, loop_time_sec * Engine::get_singleton()->get_time_scale());
if (Thread::is_main_thread()) {
RenderingServer::get_singleton()->sync();
if (RenderingServer::get_singleton()->has_changed()) {
RenderingServer::get_singleton()->draw(true, loop_time_sec * Engine::get_singleton()->get_time_scale());
}
}
}