Fixes crashes when Stop XR is pressed and when Kit is closed while Teleop is running#4752
Merged
kellyguo11 merged 3 commits intoisaac-sim:developfrom Feb 27, 2026
Merged
Conversation
Contributor
Author
Contributor
Greptile SummaryThis PR fixes crashes when Stop XR is pressed or Kit closes while Teleop is running by adding proper cleanup callbacks before OpenXR handles become invalidated. Key changes:
Critical issue found:
Confidence Score: 3/5
Important Files Changed
Last reviewed commit: f2e235c |
Signed-off-by: Kelly Guo <kellyg@nvidia.com>
f2e235c to
8399d85
Compare
…nsubscribe from GLOBAL_EVENT_PRE_SHUTDOWN event for completeness.
Contributor
Author
|
Rebased on develop and ready to merge. |
rwiltz
reviewed
Feb 27, 2026
rwiltz
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Before Kit tears down the OpenXR instance and session, we need to cleanup IsaacTeleop as the cached handles will become invalidated on Kit cleanup.
Stop XR: In the /xr/enabled callback, call _teardown_dead_session() instead of stop(). Only the session is torn down; pipeline and retargeting UI stay. step() then returns None (same as deferred start), the recording loop keeps rendering, and starting XR again works without restarting the script.
Kit close: Subscribe to GLOBAL_EVENT_PRE_SHUTDOWN with order=-100 so our cleanup runs before XRCore (order=0). We release our session and stop using our cached OpenXR handles before Kit XR tears down the OpenXR instance/session, avoiding use of invalid handles.
Fixes # (issue)
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there