godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.98k stars 20.18k forks source link

Error when opening a custom dialog in response to a quit request #34157

Open Zylann opened 4 years ago

Zylann commented 4 years ago

Godot 3.2 beta2 Windows 10 64 bits

I have a custom confirmation popup which works fine if I open it on a key press. But when I make it open in reaction to NOTIFICATION_WM_QUIT, this error prints in the console:

ERROR: Parent node is busy setting up children, move_child() failed. Consider using call_deferred("move_child") instead (or "popup" if this is from a popup).
   At: scene/main/node.cpp:332

Test project: PopupBug.zip Run, close window. This makes the dialog show up, error in console. You can press Quit to actually close the app.

KoBeWi commented 4 years ago

Still valid in 3.2.2, in 9e34ba4 it's difficult to test it properly.

Although you can prevent the error by using call_deferred on popup_centered_minsize. The actual problem is that the error message doesn't point to it directly.