On 4/19/07, Paul Giaccone
If I've understood correctly, this means that any memory allocated on the heap in MyNode must be done using bare pointers rather than smart pointers, so that Maya can delete it when it wants, not when the smart pointers say the memory can be released. MyNode and any objects that it allocates on the heap still need to have destructors to deallocate their contents, but it is up to Maya when the destructor for MyNode is called.
I don't think this is the case. MyNode's destructor will get called when Maya determines it's time to delete it, and any smart_ptr member variables will decrement their reference count. That's the ideal state of affairs, since it works as designed. The only difference is that MyNode pointers are created by a create function, and Maya cleans them up. You cannot attempt to manage MyNode pointers, since Maya determines their lifetime, however, you can (and should) manage anything not managed by Maya. --Michael Fawcett