This code results in lost events and a memory leak.

Code :
cl::Event event;
q.enqueueNDRangeKernel(kern1, cl::NullRange, cl::NDRange(a), cl::NullRange, &wait_queue, &event);
 
wait_queue.clear();
wait_queue.push_back(event);
q.enqueueNDRangeKernel(kern2, cl::NullRange, cl::NDRange(a), cl::NullRange, &wait_queue, &event);

In the c++ wrapper, cl.hpp, the Event pointer is recast into a cl_event pointer and passed through to the C function, but is not released in the process. Is this a bug?