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,11 +377,14 @@ 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 // 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; loop_time_sec = (OS::get_singleton()->get_ticks_usec() - loop_begin_usec) / 1000000.0f;
if (Thread::is_main_thread()) {
RenderingServer::get_singleton()->sync(); RenderingServer::get_singleton()->sync();
if (RenderingServer::get_singleton()->has_changed()) { if (RenderingServer::get_singleton()->has_changed()) {
RenderingServer::get_singleton()->draw(true, loop_time_sec * Engine::get_singleton()->get_time_scale()); RenderingServer::get_singleton()->draw(true, loop_time_sec * Engine::get_singleton()->get_time_scale());
} }
} }
}
mutex.lock(); mutex.lock();
packet_peer_stream->put_var("debug_exit"); packet_peer_stream->put_var("debug_exit");