[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - Calling cpSpaceRemoveCollisionHandler while still in contact
Page 1 of 1

Calling cpSpaceRemoveCollisionHandler while still in contact

PostPosted: Sun Jul 15, 2012 10:08 pm
by Beernutts
HI,

I'm getting a crash when I remove a collision handler while still in contact with a object. Here's what happens.

I have this call:
cpSpaceAddCollisionHandler(pSpace, pShape1->collision_type,
pShape2->collision_type,
OnCollision, NULL, NULL, OnSeparate, NULL);

After a while, when an object collides, for certain situations, I want to remove the callback for those 2 collision types, so I call:
cpSpaceRemoveCollisionHandler(pSpace, pShape1->collision_type,
pShape2->collision_type);

Well, i get a crash when they separate, in
contactSetFilter(), at this line:
arb->handler->separate(arb, space, arb->handler->data);
as separate is now an invalid value: 0xabababab

Any suggestions? Is this an invalid situation and it shouldn't be allowed?

BTW, I'm using v5.3.4, so you'll probably suggest I upgrade, but I'd rather not at this point.

Thanks!

Re: Calling cpSpaceRemoveCollisionHandler while still in con

PostPosted: Mon Jul 16, 2012 8:52 am
by slembcke

Re: Calling cpSpaceRemoveCollisionHandler while still in con

PostPosted: Mon Jul 16, 2012 10:34 am
by Beernutts
OK, I can probably throw a fix in there for that.

I actually may just bite the bullet and upgrade, as I need to also upgrade SFML, and I might do it all in one go.

Regardless, thanks for the help!