---
title: CFRelease
framework: corefoundation
role: symbol
role_heading: Function
path: corefoundation/cfrelease
---

# CFRelease

Releases a Core Foundation object.

## Declaration

```occ
extern void CFRelease(CFTypeRef cf);
```

## Parameters

- `cf`: A CFType object to release. This value must not be NULL.

## Discussion

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(_:)](corefoundation/cfgetallocator(_:).md)
- [CFGetRetainCount(_:)](corefoundation/cfgetretaincount(_:).md)
- [CFMakeCollectable](corefoundation/cfmakecollectable.md)
- [CFRetain](corefoundation/cfretain.md)
