You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The underlying joint has ambiguous ownership. If either of the b2Bodies it connects are destroyed, the joint will be destroyed by Box2d. This leads to double-deletion if either body is destroyed before the unique_ptr returned by our wrapper.
So we need a handle that can remove the joint, but will (hopefully) not delete it if the joint has already been destroyed. Maybe it keeps both bodies alive by containing a shared_ptr to those involved in the joint as well as the non-owning raw pointer to the joint.
The text was updated successfully, but these errors were encountered:
Handle should implement joint destruction listener. Don't scope the lifetime of the joint to the basic handle. Instead, have an optional scoped version that destroys the joint.
The underlying joint has ambiguous ownership. If either of the b2Bodies it connects are destroyed, the joint will be destroyed by Box2d. This leads to double-deletion if either body is destroyed before the unique_ptr returned by our wrapper.
So we need a handle that can remove the joint, but will (hopefully) not delete it if the joint has already been destroyed. Maybe it keeps both bodies alive by containing a shared_ptr to those involved in the joint as well as the non-owning raw pointer to the joint.
The text was updated successfully, but these errors were encountered: