Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

All the API methods which return object pointers allocate those objects and pass ownership to your code. You are responsible for freeing them when they are no longer needed. Since they are allocated in a different module, you cannot call the delete operator on them. Instead, you must call the DeleteThis() method, which all the objects inherit from the MaxwellMayaAPIObject base class. To simplify this task, the API defines a minimalistic smart pointer template called MaxwellMayaPtr which can wrap raw pointers to API objects. Instances of this the smart pointer call DeleteThis() on the wrapped object when they go out of scope. For convenience, the API also defines an instantiation of this template for every class. The name of the smart pointer instantiation is always the name of the wrapped class followed by Ptr, or ConstPtr for wrappers of const pointers. For example, the smart pointers wrapping MaxwellMayaCamera are:

...