I'm building an element that uses an external lib, and when my element is freed (it ref count reaches zero), i want to free some stuff of the external lib i use. I didn't find anything about a generic destructor function that i can override, so when my element is being freed i can free the resources that i was using on my plugin. Can anyone help me?

best regards,