title: How to resolve "pure virtual method called"
body: <p>I understand why this is happening, but I'm stuck trying to resolve it...here is what my code is doing when the error is generated (thus, leading to a crash) when my program exits...</p>
  
  <p><code>pure virtual method called</code></p>
  
  <pre><code>SomeClass::~SomeClass()
  {
     BaseClassObject-&gt;SomePureVirtualMethod(this);
  }
  </code></pre>
  
  <hr>
  
  <pre><code>void DerivedClass::SomePureVirtualMethod(SomeClass* obj)
  {
      //Do stuff to remove obj from a collection
  }
  </code></pre>
  
  <p>I never have a call to <code>new SomeClass</code> but I have a <code>QList&lt;SomeClass*&gt;</code> which I append <code>SomeClass*</code> objects to.  The purpose of this destructor in <code>SomeClass</code> is to tell <code>DerivedClass</code> to remove a specific instance of <code>SomeClass</code> from it's collection of <code>QList&lt;SomeClass*&gt;</code>.</p>
  
  <p>So, in a concrete example...</p>
  
  <p><code>BaseClass</code> = <code>Shape</code></p>
  
  <p><code>DerivedClass</code> = <code>Triangle</code></p>
  
  <p><code>SomeClass</code> = <code>ShapeProperties</code> which owns a reference to <code>Shape</code></p>
  
  <p>So, I never have a call to <code>new ShapeProperties</code> but I have a <code>QList&lt;ShapeProperties*&gt;</code> inside of <code>Triangle</code>.  The destructor in <code>ShapeProperties</code> is to tell <code>Triangle</code> to remove a specific property of <code>ShapeProperties</code> from it's collection of <code>QList&lt;ShapeProperties*&gt;</code>.</p>