How to determine which line of code is freeing a node

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By gonzalezharry

As of now, I know that there’s a signal that’s emitted when a node exits the tree. But I used it to debug and it doesn’t let me know exactly which line of code is freeing it. Also, i tried with the _exit_tree(): function but it doesn’t give me information either.

Do you guys know a way to add a sort of breakpoint or stop runtime as soon as a node is attempting to be freed by a script?

There’s get_stack() and print_stack() that might be helpful…

jgodfrey | 2023-03-29 22:27