In this example, the Scheme Palette has allocated three strings that are pointed to by its CELL data structure. The wpFreeCellData method frees these strings before allowing WPPalette to free the data structure itself.
SOM_Scope BOOL SOMLINK sch_wpFreeCellData(WPSchemePalette *self, PCELL pCell, ULONG ulIndex) { /* Free the strings associated with the cell */ FreeMem((PBYTE)(((PSCHEME)pCell)->pszAppName)); FreeMem((PBYTE)(((PSCHEME)pCell)->SaveFolderBackground.pszImageFile)); FreeMem((PBYTE)(((PSCHEME)pCell)->SaveDesktopBackground.pszImageFile)); /* Free the cell information */ return (parent_wpFreeCellData(self,pCell,ulIndex)); }