diff options
author | maxd <[email protected]> | 2017-02-09 21:04:59 +0100 |
---|---|---|
committer | Bradley Sepos <[email protected]> | 2017-02-20 14:33:29 -0500 |
commit | 514fc4f4ac4312d25680c1fd6c4eab25c5b2551a (patch) | |
tree | a6519efe3536391e688893b769a250d82e4ad1fd /libhb | |
parent | 1ec4c4a4930f49d9d2ae9ca7d76b24cfe267c136 (diff) |
opencl: better release of OpenCL context to avoid more leaks
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/cropscale.c | 4 | ||||
-rw-r--r-- | libhb/work.c | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libhb/cropscale.c b/libhb/cropscale.c index cdce872d9..b64154377 100644 --- a/libhb/cropscale.c +++ b/libhb/cropscale.c @@ -142,6 +142,10 @@ static void hb_crop_scale_close( hb_filter_object_t * filter ) { HB_OCL_BUF_FREE(hb_ocl, pv->os->bicubic_x_weights); HB_OCL_BUF_FREE(hb_ocl, pv->os->bicubic_y_weights); + if (pv->os->initialized == 1) + { + hb_ocl->clReleaseKernel(pv->os->m_kernel); + } } free(pv->os); } diff --git a/libhb/work.c b/libhb/work.c index 9010f1d3a..ad11ee005 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -1838,6 +1838,12 @@ cleanup: } hb_buffer_pool_free(); + + if (job->use_opencl) + { + hb_release_opencl_run_env(); + } + hb_job_close(&job); } |