title: Does delete on a pointer to a subclass call the base class destructor?
body: <p>I have an <code>class A</code> which uses a heap memory allocation for one of its fields. Class A  is instantiated and stored as a pointer field in another class (<code>class B</code>.</p>
  <p>When I'm done with an object of class B, I call <code>delete</code>, which I assume calls the destructor... But does this call the destructor of class A as well?</p>
  <h3>Edit:</h3>
  <p>From the answers, I take that (please edit if incorrect):</p>
  <ol>
  <li><code>delete</code> of an instance of B calls B::~B();</li>
  <li>which calls <code>A::~A();</code></li>
  <li><code>A::~A</code> <em>should</em> explicitly <code>delete</code> all heap-allocated member variables of the A object;</li>
  <li>Finally the memory block storing said instance of class B is returned to the heap - when <em>new</em> was used, it first allocated a block of memory on heap, then invoked constructors to initialize it, now after all destructors have been invoked to finalize the object the block where the object resided is returned to the heap.</li>
  </ol>