I have a small problem with a custom node I created in Maya. If I do something like:
createNode -n "MyInstance" "MyNode";
delete "MyInstance";
It doesn't call the class destructor. But, if you do a new scene, open a new file, or do anything that forces the destruction of the current scene, the destructor is finally called.
The thing is that I have some memory allocations that I would like to clear right away instead of waiting until the end to actually clear them. Because they're not needed anymore, so they should be cleared.
I looked in the documentation, and I don't see any virtual functions I could override that would be called when the node is actually deleted, or a similar event. There's such function to track connection between attributes (actually using it in this case), but no such thing for delete.
So if any of you have an idea for a bypass, or a way to simulate this, please share!
Thanks.
W