Kernels resources are now freed up correctly, clEvent destructor still causes crashes.