Is there a way of easily clearing a command queue with kernels in wait state ?

In my application, I enqueue many kernels and wait for certain events before executing these kernels.
If my application has to stop for some reason, then the command queue is filled with waiting kernels, and
so I cannot release the queue.

The hard solution is to keep another list of wait events, and run through the list , setting event status to -1.
But, is there a way of saying: I want to clear this queue, including any waiting kernels ?