destroy() functions, and it guarantees that all queued events are delivered even in the shutdown case