Safer finalizer