support for unregistering events at the end of destruction