0 votes

Hello.

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.

asked Aug 21, 2016 in Engine by Linkpy (29 points)
edited Aug 22, 2016 by Linkpy

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 How to use this Q&A? before posting your first questions.