Skip to content

script: Fix borrow hazard when resolving XRSession end promises - #46830

Merged
Gae24 merged 1 commit into
servo:mainfrom
amittenak47:issue-46715
Jul 28, 2026
Merged

Gae24 merged 1 commit into
servo:mainfrom
amittenak47:issue-46715

Conversation

@amittenak47

@amittenak47 amittenak47 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Before, end_promises was drained while holding a mutable borrow during resolve_native(). Rewrote to resolve each promise reading from an immutable borrow, and then clearing the list after.

Testing:
.\mach build -r : to test if borrow fixed in compile-time
.\mach test-wpt -r tests/wpt/tests/webxr/ : no change in test results, when comparing with main branch

Fixes #46715.

Before, end_promises was drained when calling resolve_native() while holding a borrow.

Rewritten to resolve the promises before clearing the list.

Fixes servo#46715.

Signed-off-by: Amit Anilkumar <[email protected]>
@amittenak47
amittenak47 requested a review from gterzian as a code owner July 28, 2026 09:28
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 28, 2026
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jul 28, 2026
@Gae24
Gae24 added this pull request to the merge queue Jul 28, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 28, 2026
Merged via the queue into servo:main with commit 1ed1def Jul 28, 2026
39 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 28, 2026
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.

Borrow hazard in XRSession::event_callback

4 participants