Commit efbb1d8b authored by lvs's avatar lvs
Browse files

removed codexl warning: memory leak by clCreateKernel

parent 208ced35
......@@ -1062,23 +1062,15 @@ if (strcmp(mypars->ls_method, "sw") == 0) {
clReleaseMemObject(mem_gradpars_conformation_min_perturbation);
*/
// Release all local-search kernels,
// regarless of the chosen method for execution.
// Otherwise, memory leak in clCreateKernel()
clReleaseKernel(kernel1);
clReleaseKernel(kernel2);
clReleaseKernel(kernel4);
/*
#if !defined (GRADIENT_ENABLED)
*/
if (strcmp(mypars->ls_method, "sw") == 0) {
clReleaseKernel(kernel3);
/*
#else
*/
} else if (strcmp(mypars->ls_method, "sd") == 0) {
clReleaseKernel(kernel4);
clReleaseKernel(kernel5);
/*
#endif
*/
}
clReleaseCommandQueue(command_queue);
clReleaseContext(context);
free(device_id);
......
......@@ -189,7 +189,10 @@ int ImportSource(const char* filename,
}
#endif
// Release all programs.
// Otherwise, memory leak in clCreateProgramWithSource()
clReleaseProgram(local_program);
/* *program = local_program;*/
*kernel = local_kernel;
return CL_SUCCESS;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment