WpclsUnInitData: Difference between revisions
Appearance
Created page with "{{DISPLAYTITLE:wpclsUnInitData}} 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 do..." |
|||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
;somSelf (M_WPObject *) - input: Pointer to the [[WPObject]] class object. | ;''somSelf'' (M_WPObject *) - input: Pointer to the [[WPObject]] class object. | ||
==Returns== | ==Returns== | ||
Line 44: | Line 44: | ||
==Related Methods== | ==Related Methods== | ||
* [[wpclsInitData]] | * [[wpclsInitData]] | ||
[[Category:Workplace Class Methods]] |
Latest revision as of 16:17, 28 May 2025
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); }