foo -> Cfoo object on the heap
Cfoo::bar -> int on the heap
delete foo; foo = 0;
foo -> 0
Cfoo object deleted
int still on the heap
When you call delete, only the object pointed to is deleted. If that object happens to have pointers to other locations on the heap, you'll have to take care of that in the object's destructor (best location for clean up).
This holds for both allocated objects and stack objects, i.e. even if foo was the object and not a pointer, you still need that destructor to clean up resources.
Ah, okay! Thanks for the visualization. That helped alot. I wasn't sure if C++ would take care of the members in the class. Since it doesn't, (which I guess is part of the point of the pointers) I have to release the memory myself.