wpclsUnInitData
Appearance
This method is called to allow the class object to free allocated resources.
Syntax
wpclsUnInitData(somSelf);
Parameters
- somSelf (M_WPObject *) - input
- Pointer to the WPObject class object.
Returns
There is no return value for this method.
Usage
This method is generally called only by the system when the class object is made dormant. The class object is made dormant when the last instance of this class is made dormant.
How to Override
Any class that overrides the wpclsInitData method to allocate resources for its metaclass instance variables should override this method to deallocate those resources. It is essential to pass this method onto the parent class object after performing override processing.
Example Code
Declaration:
#define INCL_WINWORKPLACE #include <os2.h> M_WPObject *somSelf; /* Pointer to the WPObject class object. */ wpclsUnInitData(somSelf);
This example overrides the method to free any data associated with the class.
SOM_Scope void SOMLINK BearsM_wpclsUnInitData(M_Bears *somSelf) { APIRET rc = NO_ERROR; /* Return code from Dos API */ M_BearsData *somThis = M_BearsGetData(somSelf); M_BearsMethodDebug("M_Bears","myfM_wpclsUnInitData"); rc = DosFreeMem( _pBearClassData ); parent_wpclsUnInitData(somSelf); }