Next: , Previous: , Up: C library functions   [Index]


free

free Function

Do not use free with objects. Use the __ctalkDeleteObject library function instead.

Also, calling __objRefCntZero before __ctalkDeleteObject insures that the object will be completely deleted. You can do this in two ways: first, by sending the object a delete message; or by casting the object to a C OBJECT * and then giving the OBJECT * as an argument to __objRefCntZero and __ctalkDeleteObject.

Object new myObject;
OBJECT *myObject_alias;

myObject_aliast = myObject;

__objRefCntZero (OBJREF (myObject_alias));
__ctalkDeleteObject (myObject_alias);