The wpUnInitData method is executed just prior to deallocation of the object's memory during the process of making the object dormant or its permanent destruction. We want to deallocate all the memory and other resources allocated during this instantiation of the object. Memory allocated via wpAllocMem() is freed automatically by one of the Workplace Shell ancestors, so we need not do it here. As in the override of wpUnInitData, the multiple inheritance issue should be addressed here as well. The following sample code shows the use of wpUnInitData:

SOM_Scope void SOMLINK stk_wpUnInitData(
                       Stack *somSelf)  // In - pointer to the object
{
  StackData *somThis = StackGetData(somSelf);
  StackMethodDebug("Stack","stk_wpUnInitData");

  if (_bInitialized)
  {
    _bInitialized = FALSE;
    _clsDecObjectCount(_somGetClass(somSelf), STK_AWAKECOUNT);
  } /* Endif */
  parent_wpUnInitData(somSelf);
} // End stk_wpUnInitData


[Back] [Next]