Skip to content

Keep BulletClient connected until disconnect succeeds - #4824

Open
Afloat16 wants to merge 1 commit into
bulletphysics:masterfrom
Afloat16:pybullet/client-disconnect-lifecycle
Open

Afloat16 wants to merge 1 commit into
bulletphysics:masterfrom
Afloat16:pybullet/client-disconnect-lifecycle

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 7, 2026

Copy link
Copy Markdown

Looking up client.disconnect currently sets the physics client ID to -1 before the caller invokes the method. Saving a callback can therefore disable the remaining client methods and skip destructor cleanup. Keep the ID until an explicit disconnect succeeds, and initialize it before connecting so cleanup is also safe when construction fails.

Verified with a mocked PyBullet connection: attribute lookup preserves the ID, failure permits retry, a successful call targets the original client, destruction after disconnect performs no second call, and destruction after connection failure is safe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant