4.4. Defining the Destructor

There is no macro for defining a destructor. Use the destructor to free up anything you created in the constructor or in any other methods for the class. For example:


C++
SoWriteAction::~SoWriteAction()
{
   // Get rid of the SoOutput if we created it in the
   // constructor
   if (createdOutput)
      delete output;
}