0 votes


I want to know if it is "good" to do this :

func free ( ):
    clear ( )
    .free ( )

If is not, is there a way to call a function when the object is freed ?
Thanks for your answers !

EDIT : I have a set of timers in a singleton. Every timer extends Object. When the node is deleted I want to delete every timer. This is why I ask this.

in Engine by (31 points)
edited by

Where are you writing this? Is it a Node? If it is, what do you want to clear? Not saying it's bad practice (I'd like to know as well), but maybe you actually don't need it.

I edited the post for those informations ^^

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.