title: C++ - when are non-pointers class member destroyed?
body: <p>Suppose I have this code...</p>
  
  <pre><code>class GraphFactory : public QObject
  {
  private:
      QMap&lt;QString, IGraphCreator*&gt; factory_;
  
  public:
      virtual ~GraphFactory();
  };
  
  GraphFactory::~GraphFactory()
  {
      // Free up the graph creators
      QMap&lt;QString, IGraphCreator*&gt;::iterator itr;
      for (itr = factory_.begin(); itr != factory_.end(); itr++)
      {
          IGraphCreator * creator = itr.value();
          delete creator;
          creator = NULL;
      }
  
  }
  </code></pre>
  
  <p>When is the QMap factory_ destroyed? Before the call to the destructor, or during the destructor? (I understand that the destructor will be called when an instance of GraphFactory goes out of scope. But when are the non-pointers member destroyed?)</p>
  
  <p><strong>Edit:</strong> I am getting invalid values for the factory_ map when it reaches the destructor. A break point shows that the value wouldn't have tampered with the value stored inside the QMap.</p>