mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 19:20:28 +08:00
fix memory leak
This commit is contained in:
parent
c58e0d5d73
commit
d81c145fa9
@ -1580,6 +1580,7 @@ static void openCLExecuteKernel_hog(Context *clCxt , const char **source, string
|
||||
{
|
||||
cl_kernel kernel = openCLGetKernelFromSource(clCxt, source, kernelName);
|
||||
size_t wave_size = queryDeviceInfo<WAVEFRONT_SIZE, size_t>(kernel);
|
||||
openCLSafeCall(clReleaseKernel(kernel));
|
||||
if (wave_size <= 16)
|
||||
{
|
||||
char build_options[64];
|
||||
|
@ -139,8 +139,9 @@ static void lkSparse_run(oclMat &I, oclMat &J,
|
||||
stringstream idxStr;
|
||||
idxStr << kernelName << "_C" << I.oclchannels() << "_D" << I.depth();
|
||||
cl_kernel kernel = openCLGetKernelFromSource(clCxt, &pyrlk, idxStr.str());
|
||||
|
||||
int wave_size = queryDeviceInfo<WAVEFRONT_SIZE, int>(kernel);
|
||||
openCLSafeCall(clReleaseKernel(kernel));
|
||||
|
||||
static char opt[16] = {0};
|
||||
sprintf(opt, " -D WAVE_SIZE=%d", wave_size);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user