5ee7d028400bcbd630a27e44ae11dd0e96e2311b
Fixes #91369, where a pointer to a deleted btTypedConstraint instance was being dereferenced, causing a crash. What was happening was: 1. When the animation starts the first time, BKE_rigidbody_rebuild_sim eventually calls btDiscreteDynamicsWorld::addConstraint, which in turn will store a pointer to the btTypedConstraint in btRigidBody::m_constraintRefs for each body in the constraint 2. When undoing, the btDynamicsWorld is deleted, then the Object containing the btTypedConstraint (taking the btTypedConstraint with it) - however, the pointer to the btTypedConstraint is still in the btRigidBody! 3. When playing the animation a second time, rigidbody_update_simulation will rebuild the simulation, which causes RB_body_delete to be called, which iterates over all the body's m_constraintRefs and dereferences the deleted pointer. Co-authored-by: Eoin Mcloughlin <hkeoin@eoinrul.es> Pull Request: https://projects.blender.org/blender/blender/pulls/126079
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
