From 67e5ceaeb811aadc9de45f624fb609e86c9c837a Mon Sep 17 00:00:00 2001 From: Homer Hsing Date: Fri, 8 Nov 2013 10:57:42 +0800 Subject: [PATCH] release context in runtime_createcontextfromtype Signed-off-by: Homer Hsing Reviewed-by: Zhigang Gong --- utests/runtime_createcontext.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utests/runtime_createcontext.cpp b/utests/runtime_createcontext.cpp index b90e915..f08a189 100644 --- a/utests/runtime_createcontext.cpp +++ b/utests/runtime_createcontext.cpp @@ -3,9 +3,12 @@ void runtime_createcontextfromtype(void) { cl_int status; - if (clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU, NULL, NULL, &status) == NULL) { + cl_context ctx; + ctx = clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU, NULL, NULL, &status); + if (ctx == NULL) { OCL_THROW_ERROR("runtime_createcontextfromtype", status); } + clReleaseContext(ctx); } MAKE_UTEST_FROM_FUNCTION(runtime_createcontextfromtype); -- 2.7.4