Jump to content

wpUnInitData

From EDM2

This instance method is called to allow the object to free allocated resources.

Syntax

wpUnInitData(somSelf)

Parameters

somSelf (WPObject *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPObject.

Returns

There is no return value for this method.

Remarks

The parent method must be called after you have completed your own processing.

Usage

This method is generally called only by the system when the object is made dormant. The object is made dormant when it is destroyed or when there are no open views and the folder containing the object are not open.

How to Override

This method is overridden to de-allocate resources allocated during the processing of wpInitData. The parent method must be called after you have completed your own processing.

Example Code

This example clears up memory that was allocated on wpInitData.

SOM_Scope void   SOMLINK myf_wpUnInitData(MYFILE *somSelf)
{
    MYFILEData *somThis = MYFILEGetData(somSelf);
    MYFILEMethodDebug("MYFILE","myf_wpUnInitData");

    if (_pszLastWorker)
    {
      _wpFreeMem(somSelf,
                  (PBYTE)_pszLastWorker);  /* Free this area */
    }

    parent_wpUnInitData(somSelf);  /* Call parent method last */

}

Related Methods