|Home > Execution stages of an OpenCL application > Cleaning up unused objects|
When the application no longer requires the objects associated with the OpenCL runtime and context, you must release these resources. You can use several functions to release your OpenCL objects.
These functions decrement the reference count for the associated object:
Ensure the reference counts for all OpenCL objects reach zero
when your application no longer requires them. You can obtain the
reference count by querying the object. For example, by calling