Your example code on the other hand is weird. Freeing an object in the middle of its member method begs for trouble.
It's just an example. In my real code the method with const string parameter was in the form and the object-to-delete was another component. So actually quite a normal task.