Skip to content

Fix panic when despawning joints after despawning their bodies#882

Merged
Jondolf merged 1 commit into
mainfrom
fix-joint-removal-panic
Nov 1, 2025
Merged

Fix panic when despawning joints after despawning their bodies#882
Jondolf merged 1 commit into
mainfrom
fix-joint-removal-panic

Conversation

@Jondolf

@Jondolf Jondolf commented Oct 31, 2025

Copy link
Copy Markdown
Member

Objective

Fixes #835.

Removing a joint after its body has been removed results in a panic, as the island no longer exists.

Solution

Return early if the island doesn't exist. This isn't the best fix (ideally we should remove the joint from the island as soon as the bodies are removed, but this is tricky currently), however it seems to fix the most imminent problem of crashes.

Testing

Ran the example in #835. Crashed before, but not anymore.

@Jondolf Jondolf added this to the 0.4.1 milestone Oct 31, 2025
@Jondolf Jondolf added C-Bug Something isn't working P-Crash A sudden unexpected crash A-Joints Relates to joints constraining the relative positions and orientations of rigid bodies labels Oct 31, 2025
@Jondolf Jondolf enabled auto-merge (squash) November 1, 2025 00:01
@Jondolf Jondolf merged commit bf498f3 into main Nov 1, 2025
6 checks passed
@Jondolf Jondolf deleted the fix-joint-removal-panic branch November 1, 2025 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Joints Relates to joints constraining the relative positions and orientations of rigid bodies C-Bug Something isn't working P-Crash A sudden unexpected crash

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RevoluteJoint panic on main branch

1 participant