Conceptually, hiding of closing/freeing memory is the idea of RAII.
However, I do have noticed that people are confused as hell when you go beyond the normal "free memory" and "close stream" things. I once had a NetworkPacket class, during initialization you give the socket that you want to sent it trough. And then during destruction it would get send.
It got people confused really fast. And was a good example of a bad design decision, even tough it made writing the code quicker and less error prone.
Right now, I have code that does this:
bool MyObject::onDamage(int amount)
{
hp -= amount;
if (hp <= 0)
delete this;
}
While deleting yourself is perfectly valid in my code, as long as it's the last thing you do with that object. It might cause a few:
from people.