Topic was automatically imported from the old Question2Answer platform.
Asked By
rakkarage
extends Control
func _enter_tree() -> void:
print("enter")
func _exit_tree() -> void:
print("exit2")
func _notification(what: int) -> void:
if what == NOTIFICATION_EXIT_TREE:
print("exit1")
i am having trouble seeing output from _exit_tree when i close my app in godot4… I see enter but can’t see exit unless I put breakpoint on second print("exit1")? then I see exit2?
I assume this is related to how often print statements are flushed. Ideally, they’d be flushed after each print, but that can be unacceptably slow (especially on some OSs), so they’re probably flushed less often by default - which leads to the case you describe (print output not flushed before app closes).
While I’m not entirely sure, there are a few Project Settings that might impact your results:
Project Settings
Turn on Advanced Settings switch
Under Application | Run
Flush stdout on Print
Flush stdout on Print.debug
Thanks for help.
I just tried this and it did not work…
It is on by default for print_debug i guess, but that does not work either…
Would have been an ideal solution.