/** * Release each of the given contexts if it is not <code>null</code>. * * @param contexts The contexts to release */ public static void release(Iterable<cl_context> contexts) { if (contexts != null) { for (cl_context context : contexts) { if (context != null) { clReleaseContext(context); } } } }
/** * Release each of the given contexts if it is not <code>null</code>. * * @param contexts The contexts to release */ public static void release(cl_context... contexts) { if (contexts != null) { for (cl_context context : contexts) { if (context != null) { clReleaseContext(context); } } } }
@Override protected void finalize() throws Throwable { clReleaseCommandQueue(commandQueue); clReleaseContext(context); super.finalize(); }