diff options
Diffstat (limited to 'scene/main/scene_tree.cpp')
-rw-r--r-- | scene/main/scene_tree.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index f7dec77ce4..be4878588e 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -535,10 +535,15 @@ bool SceneTree::idle(float p_time) { //go through timers + List<Ref<SceneTreeTimer> >::Element *L = timers.back(); //last element + for (List<Ref<SceneTreeTimer> >::Element *E = timers.front(); E;) { List<Ref<SceneTreeTimer> >::Element *N = E->next(); if (pause && !E->get()->is_pause_mode_process()) { + if (E == L) { + break; //break on last, so if new timers were added during list traversal, ignore them. + } E = N; continue; } @@ -550,6 +555,9 @@ bool SceneTree::idle(float p_time) { E->get()->emit_signal("timeout"); timers.erase(E); } + if (E == L) { + break; //break on last, so if new timers were added during list traversal, ignore them. + } E = N; } @@ -631,6 +639,7 @@ void SceneTree::_notification(int p_notification) { } } break; case NOTIFICATION_OS_MEMORY_WARNING: + case NOTIFICATION_OS_IME_UPDATE: case NOTIFICATION_WM_MOUSE_ENTER: case NOTIFICATION_WM_MOUSE_EXIT: case NOTIFICATION_WM_FOCUS_IN: @@ -1965,6 +1974,7 @@ SceneTree::SceneTree() { root = memnew(Viewport); root->set_name("root"); + root->set_handle_input_locally(false); if (!root->get_world().is_valid()) root->set_world(Ref<World>(memnew(World))); |