What steps will reproduce the problem?
1. Start CollisionProcessing demo
2. Press space and launch bomb twice
3.
What is the expected output? What do you see instead?
The second bomb won't appear.
What version of the product are you using? On what operating system?
2.1.0
Please provide any additional information below.
This is because the m_bomb object may be destroyed by Step of
CollisionProcessing in the code block,
while (i < nukeCount)
{
b2Body* b = nuke[i++];
while (i < nukeCount && nuke[i] == b)
{
++i;
}
m_world->DestroyBody(b);
}
Solution: change to
while (i < nukeCount)
{
b2Body* b = nuke[i++];
while (i < nukeCount && nuke[i] == b)
{
++i;
}
if (b != m_bomb0)
m_world->DestroyBody(b);
}
Original issue reported on code.google.com by wqyfavo...@gmail.com on 19 Mar 2010 at 3:26
Original issue reported on code.google.com by
wqyfavo...@gmail.com
on 19 Mar 2010 at 3:26