title: Memory Deallocating freezes my program
body: <p><strong>This is not a problem, just a question that I want to be answered.</strong></p>
  
  <p>I'm making 2D application that has particles. In the click handler I've written this code:</p>
  
  <pre><code>Particle *tempp = new Particle();
  tempp-&gt;setPosition(mx, my);
  particles.push_back(tempp); // typeof particles = std::list&lt;Particle*&gt;
  delete tempp; // &lt;- this line is the problem
  </code></pre>
  
  <p>When I click, one particle will be created at the mouse position. After about one second it should disappears, which works fine. After it's disappeared I can click again to create a new particle.</p>
  
  <p>However, when I click while there still is one particle on the screen, my program freezes and stops working.</p>
  
  <p>My <em>destructor</em> of the <code>Particle</code> class and it's parent's <em>destructor</em> are both empty.</p>
  
  <p>WITHOUT calling <code>delete</code> my program runs fine, even with multiple particles at once, or even multiple per frame. I am just wondering what is causing this freezing issue.</p>