title: Exception thrown at 0x00007FF746DA221B SDL_game.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF
body: <p>I am trying to debug my application and I constantly receive this error and I don't know how to fix it. While debugging I found out that the place of the error is the function parseObjects. It also invokes a create function from the game object factory which is as follows ...</p>
  
  <p><code>GameObject* GameObjectFactory::create(std::string typeID)
  {
  std::map&lt;std::string, BaseCreator*&gt;::iterator it = m_creators.find(typeID);</code></p>
  
  <pre><code>if (it == m_creators.end()) 
  {
      std::cout &lt;&lt; "could not find type: " &lt;&lt; typeID &lt;&lt; "\n";
      return 0;
  }
  
  BaseCreator* pCreator = (*it).second;
  return pCreator-&gt;createGameObject();}
  </code></pre>
  
  <p>After this it invokes a Creator objects load function which loads the parameters successfully, but when it tries to push the object back into the vector it receive the up stated error.</p>
  
  <p>Exception thrown at 0x00007FF746DA221B SDL_game.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.</p>
  
  <pre><code>    ...
      e-&gt;Attribute("x", &amp;x);
      e-&gt;Attribute("y", &amp;y);
      e-&gt;Attribute("width", &amp;width);
      e-&gt;Attribute("height", &amp;height);
      e-&gt;Attribute("numFrames", &amp;numFrames);
      e-&gt;Attribute("callbackID", &amp;callbackID);
      e-&gt;Attribute("animSpeed", &amp;animSpeed);
  
      type = e-&gt;Attribute("type");
      textureID = e-&gt;Attribute("textureID");
  
      GameObject* pGameObject = TheGameObjectFactory::Instance()-&gt;create(type);
      pGameObject-&gt;load(new LoaderParams(x, y, width, height, textureID, numFrames, callbackID, animSpeed)); 
      pObjects-&gt;push_back(pGameObject); // fails on this line ???
  }`
  </code></pre>
  
  <p>The debugger goes to this line in vector...
  <code>bool _Inside(const value_type *_Ptr) const
          {   // test if _Ptr points inside vector
          return (_Ptr &lt; this-&gt;_Mylast() &amp;&amp; this-&gt;_Myfirst() &lt;= _Ptr);
          }</code></p>
  
  <p>Any help and suggestions will be appreciated...</p>