1-142 SOMobjects Base Toolkit: Programmer’s Reference Manual
somFree Method
Purpose
Releases the storage used by an object and frees the object. Intended for use by object
clients. Not generally overridden.
IDL Syntax
void somFree ( );
Note: For backward compatibility, this method does not take an Environment parameter.
Description
The somFree method releases the storage containing the receiver object by calling the
method somDeallocate. No future references should be made to the receiver once this is
done. Before releasing storage, somFree calls somUninit to allow storage pointed to the
object to be freed.
The somFree method should not be called on objects created by somRenew, thus the
method is normally only used by code that also created the object.
Note: SOM also supplies a function, SOMFree, which is used to free a block of memory.
This function should not be used on objects.
Parameters
receiver A pointer to the object to be freed.
C Example
#include <animal.h>
void main()
{
Animal myAnimal;
/*
* Create an object.
*/
myAnimal = AnimalNew();
/* ... */
/* Free it when finished. */
_somFree(myAnimal);
}
Original Class
SOMObject
Related Information
Methods: somNew, somNewNoInit, somUninit
Functions: SOMFree
Kommentare zu diesen Handbüchern