From fed8788e5dfa89197582d9e4fc0d89f4d67a19d8 Mon Sep 17 00:00:00 2001 From: maxd Date: Sat, 4 Feb 2017 20:31:31 +0100 Subject: [PATCH] opencl: fixing leaks for clBuffers (cherry picked from commit 1ec4c4a4930f49d9d2ae9ca7d76b24cfe267c136) --- libhb/openclwrapper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libhb/openclwrapper.c b/libhb/openclwrapper.c index 92cc18287..c906f68f9 100644 --- a/libhb/openclwrapper.c +++ b/libhb/openclwrapper.c @@ -1126,6 +1126,11 @@ int hb_cl_free_mapped_buffer(cl_mem mem, unsigned char *addr) hb_ocl->clWaitForEvents(1, &event); else hb_log("hb_free_mapped_buffer: error %d", status); + + status = hb_ocl->clReleaseMemObject(mem); + if (status != CL_SUCCESS) + hb_log("hb_free_mapped_buffer: release error %d",status); + return (status == CL_SUCCESS) ? 1 : 0; } -- 2.40.0