Page MenuHome

T38448 further bug fix
AbandonedPublic

Authored by Alan Troth (Al) on Aug 12 2015, 2:47 AM.

Details

Summary

Fixed a further bug where a memory leak would occur when removing btTypedConstraint.

Diff Detail

Repository
rB Blender

Event Timeline

Alan Troth (Al) retitled this revision from to T38448 further bug fix and unneeded code removal..
Alan Troth (Al) updated this object.
Alan Troth (Al) set the repository for this revision to rB Blender.
Alan Troth (Al) added a project: Game Engine.
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
534

body is defined earlier, no ?

Thomas Szepe (hg1) requested changes to this revision.Aug 12 2015, 9:08 AM
Thomas Szepe (hg1) edited edge metadata.

Your patch will revert my changes introduced in D1007.
The rigid body it self only stores the constraints that are assigned to this object. So your modifications will break the constraint deletion if the rigid body B (target) is deleted.

source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
544–545

You deleted one space in front of asterisk. But the original is correct.
Look at the Blender code style guide.

1127–1129

I wouldn't use a Doxygen comment here.
Use a normal comment multi line here.

/*
 *
 */
This revision now requires changes to proceed.Aug 12 2015, 9:08 AM

Your patch will revert my changes introduced in D1007.
The rigid body it self only stores the constraints that are assigned to this object. So your modifications will break the constraint deletion if the rigid body B (target) is deleted.

I didn't fully revert all the changes introduced in D1007, but I can now see the changes I made wouldn't work as I thought. I assumed that a tRigidBody kept track of all constraints attached to it, and the other tRigidBody could be found from those constraints. I didn't see that if 'disableCollisionBetweenLinkedBodies' is false when the constraint is created then the tRigidBody doesn't keep track of the it.

I'll submit a new patch soon.

Thanks.

Alan Troth (Al) retitled this revision from T38448 further bug fix and unneeded code removal. to T38448 further bug fix.Aug 13 2015, 6:43 PM
Alan Troth (Al) updated this object.
Alan Troth (Al) edited edge metadata.
Alan Troth (Al) edited edge metadata.
Alan Troth (Al) removed rB Blender as the repository for this revision.

New patch that fixes a possible constraint memory leak.
Also adjusted the layout of a couple of comments.

I've somehow "removed rB Blender as the repository for this revision.". It was probably something I missed when submitting the new patch. Is this something I need to fix?

Also hg1 made a note about multi line comments which has moved itself a few lines from where it should be. Is this something that just happens or should I have ticked an option somewhere that I didn't?

I've somehow "removed rB Blender as the repository for this revision.". It was probably something I missed when submitting the new patch. Is this something I need to fix?

No you don't need to add it. Just for info. You can always edit the differential by using the "Edit Revision" on the top right.

Also hg1 made a note about multi line comments which has moved itself a few lines from where it should be. Is this something that just happens or should I have ticked an option somewhere that I didn't?

This is something that just happens. You can only mark the comment as done then the comments are gone with the next diff.

Some Notes:
For the title we use the prefix BGE: and if it is a fix BGE: Fix T38448: Text. If you use Fix T38448 and the patch will be committed this revision will be automatically closed.
"further bug fix" is not a good title. Because this title and summary will be used for the git history log.
http://wiki.blender.org/index.php/Dev:Doc/New_Committer_Info#Bug_fixes
When you update the patch you can change the title and summary too.

To your patch:
This patch will cause a crash if the one of the objects is a sensor or character. Because for this objects no userPointer will be set.
Adding a check for it here will also not work properly, because then the constraint will not be deleted if the sensor object will be deleted.
Basically we need a to do it like I have done D1329 (two lists one stores the constraints on the owner and one stores the owner on the target).

You don't need to update your patch. Because I actually working on a fix for that.

Alan Troth (Al) abandoned this revision.Aug 16 2015, 1:13 AM

Thanks for spending your time giving reviews and advice.
Al.