How to free memory allocated by AddTrackable()
Posted: Sun Jan 31, 2021 2:57 pm
I'm using AddTrackable() to track an object that should be destroyed when the task is removed. That works fine. When the task is removed, my destructor function is called and I can destroy the object.
But: Once my destructor function has been called and the task has been removed, how should I free the memory allocated by AddTrackable()?
I've seen these options:
1) DeleteTrackable(): Autodocs say that this will first call the destructor function before deleting the trackable. This is of course not what I want because the destructor function has been called already. I just want to free the memory allocated by AddTrackable().
2) RemTrackable(): This won't free any memory but will just remove the trackable from the task's resource list.
So I don't see any function that just frees the trackable. How should it be done then?
But: Once my destructor function has been called and the task has been removed, how should I free the memory allocated by AddTrackable()?
I've seen these options:
1) DeleteTrackable(): Autodocs say that this will first call the destructor function before deleting the trackable. This is of course not what I want because the destructor function has been called already. I just want to free the memory allocated by AddTrackable().
2) RemTrackable(): This won't free any memory but will just remove the trackable from the task's resource list.
So I don't see any function that just frees the trackable. How should it be done then?