Use a OwningPtr instead of a manual delete.