title: Lack of virtual destructor when doing "delete this"
body: <p>Section <a href="http://www.parashift.com/c++-faq-lite/freestore-mgmt.html#faq-16.15" rel="nofollow">16.15 of the C++ FAQ Lite</a> discusses <code>delete this</code> and then mentions:</p>
  
  <blockquote>
    <p>Naturally the usual caveats apply in cases where your this pointer is
    a pointer to a base class when you don't have a virtual destructor.</p>
  </blockquote>
  
  <p>Why is this true? Consider this code:</p>
  
  <pre><code>class ISuicidal {
  public:
      virtual void suicide() = 0;
  };
  
  class MyKlass : public ISuicidal {
  public:
      MyKlass() {
          cerr &lt;&lt; "MyKlass constructor\n";
      }
  
      ~MyKlass() {
          cerr &lt;&lt; "MyKlass destructor\n";
      }
  
      void suicide() {
          delete this;
      }
  };
  </code></pre>
  
  <p>Used thus:</p>
  
  <pre><code>int main()
  {
      ISuicidal* p = new MyKlass;
      p-&gt;suicide();
      return 0;
  }
  </code></pre>
  
  <p>In the call <code>p-&gt;suicide()</code>, the destructor of <code>MyKlass</code> is called as expected, <em>even though <code>ISuicidal</code> has no virtual destructor</em>.</p>
  
  <p>To me this makes sense, because in <code>MyKlass::suicide</code>, the static type of <code>this</code> is known to be <code>MyKlass*</code>, so the correct destructor is invoked. This is easy to verify by placing <code>typeid</code> calls inside <code>suicide</code>.</p>
  
  <p>So is the FAQ entry inaccurate, or am I misunderstanding it?</p>