Peter Colberg wrote: > local cl_event_1 = ffi.typeof("cl_event[1]") > > local function enqueue_marker(queue) > local event = cl_event_1() > local status = C.clEnqueueMarker(queue, event) > if status ~= C.CL_SUCCESS then return error(errors[status]) end > return ffi.gc(event[0], release_event) > end This looks suspicious: 'event' is not anchored and you create a new cdata pointer object from it with 'event[0]', which has the finalizer attached. --Mike