]> granicus.if.org Git - handbrake/commitdiff
opencl: better release of OpenCL context to avoid more leaks
authormaxd <maxim.d33@gmail.com>
Thu, 9 Feb 2017 20:04:59 +0000 (21:04 +0100)
committerBradley Sepos <bradley@bradleysepos.com>
Mon, 20 Feb 2017 19:34:26 +0000 (14:34 -0500)
(cherry picked from commit 514fc4f4ac4312d25680c1fd6c4eab25c5b2551a)

libhb/cropscale.c
libhb/work.c

index cdce872d97b0cf8de864013ceeea181eaf9370d0..b64154377c0645c90dee6bb85e47375490b43317 100644 (file)
@@ -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);
     }
index 9010f1d3aa32371c2b45dcc2bbace96f58fe33ca..ad11ee005430cdb92e490f91703cc70e409bf9c5 100644 (file)
@@ -1838,6 +1838,12 @@ cleanup:
     }
 
     hb_buffer_pool_free();
+
+    if (job->use_opencl)
+    {
+        hb_release_opencl_run_env();
+    }
+
     hb_job_close(&job);
 }