From fdb94e340960061bdc38ef9a2ce0cd84bbfc5e3e Mon Sep 17 00:00:00 2001 From: Anish Bhobe Date: Sat, 9 Mar 2019 17:06:37 +0530 Subject: [PATCH] Fixes physic_fps=0 bug. Added a condition to check if the loop exited without iteration being run by checking the return value from idle(). Fixes: #26321 (cherry picked from commit 3c27980a178ce26e584b36ea4bf2fc3f661c903b) --- main/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/main.cpp b/main/main.cpp index e8504d67680..efcfb1a749e 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1876,7 +1876,9 @@ bool Main::iteration() { uint64_t idle_begin = OS::get_singleton()->get_ticks_usec(); - OS::get_singleton()->get_main_loop()->idle(step * time_scale); + if (OS::get_singleton()->get_main_loop()->idle(step * time_scale)) { + exit = true; + } message_queue->flush(); VisualServer::get_singleton()->sync(); //sync if still drawing from previous frames.