title: Having an issue with c++ stl lists
body: <p>I have the following function.</p>
  
  <pre><code>void BulletFactory::update(Uint32 ticks) {
    std::list&lt;Sprite*&gt;::iterator it = activeBullets.begin();
    while (it != activeBullets.end()) {
      (*it)-&gt;update(ticks);
      if(!((*it)-&gt;inView())) {
        activeBullets.remove(*it);
        Sprite* temp = *it;
        it++;
        inactiveBullets.push_back(temp);
      } else {
        it++;
      }
    }
  }
  </code></pre>
  
  <p>when the condition <code>!((*it)-&gt;inView())</code> is being <code>true</code> there is a segmentation fault. I am not able to see the problem.</p>
  
  <p>edit: forgot to mention that activeBullets and inactiveBullets are two lists.</p>