Godot: Timer error spam in editor

Created on 3 Sep 2019  路  8Comments  路  Source: godotengine/godot

Godot version:
750f8d4

Issue description:
After #31844 was merged, this spams in the console on editor startup and when running scene:

ERROR: Timer was not added to the SceneTree!
   At: scene\main\timer.cpp:111

Look like editor used Timers that were started outside tree.

bug regression editor

Most helpful comment

TextEdit and LineEdit start the blinking timer before entering the scene tree. Also, these timers are running even when the controls are not in focus, which is hundreds of them in the editor.
I'm working on a fix to make them run only when needed.

All 8 comments

Hello!
It's a meh! The author of the PR that causes this!
No idea why though 馃

I'll look into it

Capture

Tried to add these wayward Timers to the tree, but this crashes the editor... Seems that the tree doesn't exist yet unfortunately (or something equally problematic)

@2shady4u If the node is not inside tree, you obviously can't use get_tree(). This method doesn't access some global SceneTree singleton.

btw, you can use print_line instead of cout.

Capture

Tried to add these wayward Timers to the tree, but this crashes the editor... Seems that the tree doesn't exist yet unfortunately (or something equally problematic)

Easiest thing to do is set a breakpoint at Timer::start() and run the editor in debug mode. Then trace the call stack to see what called it. Your cout is the same as the error message so it doesn't necessarily reveal any extra info.

Don't forget, you will have to manually attach the editor because it opens the project manager, which opens another process for the actual editor.

This happens only in function cursor_set_blink_enabled
Screenshot_20190904_103035
Screenshot_20190904_102942

@qarmin but both these caret_blink_timers are added to the tree? So how can they be the cause of this?

Capture

actually add_child() does not mean added to scene tree, it just adds it to a another node.
maybe, its parent is not added to tree yet.

TextEdit and LineEdit start the blinking timer before entering the scene tree. Also, these timers are running even when the controls are not in focus, which is hundreds of them in the editor.
I'm working on a fix to make them run only when needed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nunodonato picture nunodonato  路  3Comments

Spooner picture Spooner  路  3Comments

testman42 picture testman42  路  3Comments

blurymind picture blurymind  路  3Comments

rgrams picture rgrams  路  3Comments