Hi Atilim,
during a frame, I remove the fixture and the body of a sprite:
local body = self.xBody
local fixture = self.xFixture
body:destroyFixture(fixture)
world:destroyBody(body) |
So far so good. The problem is, sometimes an event listener like onEndContact
fires with the destroyed fixture and so crashes with an error like this:
main.lua:885: Fixture is already destroyed. |
The offending line here is
local bodyB = fixtureB:getBody() |
Imho it happens when there are more than one contacts in a frame and after the first the fixture is destroyed. The event listener is added tot he world. Before firing an event, Gideros should check if one of the two fixtures are already destroyed and not call the event listener then.
Cheers
Michael
Comments
No idea if that's clear enough or really what your talking about.
Mike
http://www.sharksoupstudios.com
@mykyl66 good tip