title: Vector push_back Access Violation
body: <p>This is probably a silly error, but it's driving me nuts trying to fix it.</p>
  
  <p>I have a struct:</p>
  
  <pre><code>struct MarkerData
  {  
   int pattId;
   unsigned short boneId;
   Ogre::Matrix4 transToBone;
   Ogre::Vector3 translation;
   Ogre::Quaternion orientation;
  
   MarkerData(int p_id, unsigned short b_id, Ogre::Matrix4 trans)
   {
    pattId = p_id;
    boneId = b_id;
    transToBone = trans;
   }
  };
  </code></pre>
  
  <p>And a class:</p>
  
  <pre><code>class TrackingSystem
  {
   public:
    void addMarker(int pattId, unsigned short boneId, Ogre::Matrix4 transToBone);
  
   private:  
    std::vector &lt;MarkerData&gt; mMarkers;
  };
  </code></pre>
  
  <p>Now, in the addMarker method:</p>
  
  <pre><code>    void TrackingSystem::addMarker(int pattId, unsigned short boneId, Ogre::Matrix4 transToBone)
  {
      mMarkers.push_back(MarkerData(pattId,boneId,transToBone));
  }
  </code></pre>
  
  <p>This push_back causes an access violation "Unhandled exception at 0x00471679 in OgreAR.exe: 0xC0000005: Access violation reading location 0x00000018.".</p>
  
  <p>As a test, I tried this:</p>
  
  <pre><code>void TrackingSystem::addMarker(int pattId, unsigned short boneId, Ogre::Matrix4 transToBone)
      {
          std::vector &lt;MarkerData&gt; test;
          test.push_back(MarkerData(pattId,boneId,transToBone));
      }
  </code></pre>
  
  <p>This works fine.</p>
  
  <p>What am I doing wrong?!  Thanks!</p>