Function

CFRelease

Releases a Core Foundation object.

Declaration

void CFRelease(CFTypeRef cf);

Parameters

cf

A CFType object to release. This value must not be NULL.

Discussion

If the retain count of cf becomes zero the memory allocated to the object is deallocated and the object is destroyed. If you create, copy, or explicitly retain (see the CFRetain function) a Core Foundation object, you are responsible for releasing it when you no longer need it (see Memory Management Programming Guide for Core Foundation).

Special Considerations

If cf is NULL, this will cause a runtime error and your application will crash.

See Also

Memory Management

CFGetAllocator

Returns the allocator used to allocate a Core Foundation object.

CFGetRetainCount

Returns the reference count of a Core Foundation object.

CFMakeCollectable

Makes a newly-allocated Core Foundation object eligible for garbage collection.

CFRetain

Retains a Core Foundation object.