It is "good" to override "free" methods ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Linkpy
:warning: Old Version Published before Godot 3 was released.

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.

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.

Zylann | 2016-08-21 23:55

I edited the post for those informations ^^

Linkpy | 2016-08-22 15:30