summaryrefslogtreecommitdiff
path: root/src/cl_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cl_context.c')
-rw-r--r--src/cl_context.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cl_context.c b/src/cl_context.c
index 1ba23024..4b8281c1 100644
--- a/src/cl_context.c
+++ b/src/cl_context.c
@@ -342,6 +342,7 @@ cl_context_new(struct _cl_context_prop *props, cl_uint dev_num, cl_device_id* al
TRY_ALLOC_NO_ERR (ctx->drv, cl_driver_new(props));
ctx->props = *props;
ctx->ver = cl_driver_get_ver(ctx->drv);
+ ctx->image_queue = NULL;
exit:
return ctx;
@@ -362,6 +363,11 @@ cl_context_delete(cl_context ctx)
if (CL_OBJECT_DEC_REF(ctx) > 1)
return;
+ if (ctx->image_queue) {
+ clReleaseCommandQueue(ctx->image_queue);
+ ctx->image_queue = NULL;
+ }
+
/* delete the internal programs. */
for (i = CL_INTERNAL_KERNEL_MIN; i < CL_INTERNAL_KERNEL_MAX; i++) {
if (ctx->internal_kernels[i]) {