[Beignet] [PATCH] release context in runtime_createcontextfromtype
Zhigang Gong
zhigang.gong at linux.intel.com
Thu Nov 7 21:09:50 PST 2013
LGTM, thanks.
On Fri, Nov 08, 2013 at 10:57:42AM +0800, Homer Hsing wrote:
> Signed-off-by: Homer Hsing <homer.xing at intel.com>
> ---
> 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);
> --
> 1.8.3.2
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list