a lot of well known API objects has some kind of public Release method. Why?
Because you don't delete those types of objects. You create them; you release them. Note: if you're talking about COM objects, you can also AddRef/Release in matched pairs.
To clarify, I'm assuming you're talking about an object that, when it's created or allocated, then creates and allocates for itself needed objects. E.g.,
Object::Object()
{
Create( device ); // EDIT: or device->AddRef()
GlobalAlloc( myMemory );
}
Object::~Object()
{
if( device ) Release( device ); // Note: the object's responsibility.
//device = NULL; // NO!!
if( myMemory ) GlobalFree( myMemory ); // because this object allocated it.
myMemory = NULL; // Not really necessary?
}
For COM objects, Release() must be public. How would you release it otherwise?
Releasing the device (in the above) may not result in the device's destruction, if other objects needed it, called device->AddRef, and haven't called Release yet. That's not this Object's responsibility. The device will take care of itself.