title: Random EXC_BAD_ACCESS due to something I must have overlooked
body: <p>I'm back to C++ after a long while, and I wanted to do it with style so I dived face-first into libCinder and started doing stuff I had rarely done before (and even then I used to prefer Qt for a number of reasons). What can go wrong with this plan?</p>
  
  <p>The thing is that very little does, especially when I run my code from inside Xcode using the Debug profile and with several safety belts strapped on (aka debugger), but then I have to go into the wild and nasty stuff happens: users get too excited, something is not tight enough, and eventually my application miserably crashes.</p>
  
  <p>I managed to narrow down the culprits to the PilotStudyApp::draw() function (see the code here <a href="https://github.com/Morpheu5/PilotStudy" rel="nofollow">https://github.com/Morpheu5/PilotStudy</a>), most likely around the last for loop, the one that goes through the _activePoints, but I can't be sure as you can see from the bt</p>
  
  <pre><code>Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
  0   libstdc++.6.dylib               0x914635e4 std::_Rb_tree_increment(std::_Rb_tree_node_base*) + 15
  1   org.cinder.PilotStudy           0x000916b3 PilotStudyApp::draw() + 419
  2   org.cinder.PilotStudy           0x000c34ad -[CinderView drawRect:] + 125
  </code></pre>
  
  <p>that you can see entirely here: <a href="http://pastebin.com/izZcFy8p" rel="nofollow">http://pastebin.com/izZcFy8p</a></p>
  
  <p>I have a strong feeling that something's up with my C++-fu (or lack thereof) so if you guys can spot something I have overlooked, I'll be extremely grateful (since I don't want to go for Processing, it'd feel like going back to kindergarten :)</p>
  
  <p><strong>EDIT</strong>: It just occurred to me that STL may not be thread-safe so synchronising, or making local copies, should resolve perhaps?</p>