Contact Handling Bug

First let me start of by saying that I really appreciate the time you have been spending on this. It's really cool! Anyways I think I have found a bug. I have been trying to use the contact list in b2World to notify entities of collisions. Here is the gist of the code I wrote to process contacts.

Code:
   mpWorld->Step(TIMESTEP, ITERATIONS);

   for( b2Contact* c = mpWorld->GetContactList(); c != NULL; c = c->GetNext() )
   {
      if( c->GetManifoldCount() > 0 )
      {
         notifyContact(c);
      }
   }


When I run this code it seems that I only receive a notification about 50% of the time an object is hit. I'm no expert on the inner workings of the engine but it seems like contacts can be created and deleted within one call to Step before it returns. To attempt to alleviate this problem I hacked a similar loop into b2World::Step right before m_broadPhase->Flush() is called and it is able to catch most collisions but still not all. My guess is that it may have something to do with restitution since it seems to happen when there are collisions with bouncy objects.
Good find! I'll work on a fix for 1.4.1.
I have a fix for this in SVN. I'll let is simmer a few days then push out 1.4.1 in a few days.

Please test the SVN version if you have time.
Bug seems to be fixed. Thanks!

Original thread: https://box2d.org/forum/viewtopic.php?t=70