Fixed a further bug where a memory leak would occur when removing btTypedConstraint.
Details
- Reviewers
Porteries Tristan (panzergame) Thomas Szepe (hg1) - Maniphest Tasks
- T38448: BGE bullet physics constraint memory leak
Diff Detail
- Repository
- rB Blender
Event Timeline
| source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | ||
|---|---|---|
| 534 | body is defined earlier, no ? | |
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. | |
| 1127–1129 | I wouldn't use a Doxygen comment here. /* * */ | |
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.
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?
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.