Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CursorPlugin causes panic when window is closed #15490

Closed
PPakalns opened this issue Sep 28, 2024 · 0 comments · Fixed by #15492
Closed

CursorPlugin causes panic when window is closed #15490

PPakalns opened this issue Sep 28, 2024 · 0 comments · Fixed by #15492
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Milestone

Comments

@PPakalns
Copy link
Contributor

PPakalns commented Sep 28, 2024

Bevy version

Main branch (6963b58)

What you did

Upon closing window, main thread panics.

What went wrong

thread 'main' panicked at ~/.cargo/git/checkouts/bevy-4791836925474557/6963b58/crates/bevy_ecs/src/system/commands/mod.rs:1714:13:
error[B0003]: ~/.cargo/git/checkouts/bevy-4791836925474557/6963b58/crates/bevy_render/src/view/window/cursor.rs:171:10: Could not insert a bundle (of type bevy_winit::state::PendingCursor) for entity 0v1#4294967296 because it doesn't exist in this World. See: https://bevyengine.org/learn/errors/b0003

Additional information

Looks like CursorPlugin tries to access entity that was just removed (window closed).

.insert(PendingCursor(Some(CursorSource::System(

@PPakalns PPakalns added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Sep 28, 2024
@pablo-lua pablo-lua added A-Windowing Platform-agnostic interface layer to run your app in S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! D-Straightforward Simple bug fixes and API improvements, docs, test and examples and removed S-Needs-Triage This issue needs to be labelled labels Sep 28, 2024
@alice-i-cecile alice-i-cecile added this to the 0.15 milestone Sep 28, 2024
github-merge-queue bot pushed a commit that referenced this issue Sep 28, 2024
# Objective

- Fixes #15490 introduced in #15094.

## Solution

- Use non-panicking `try_insert`

## Testing

- Closing window with `CursorIcon` no longer crashes after this change
(confirmed with `window_settings` example)
robtfm pushed a commit to robtfm/bevy that referenced this issue Oct 4, 2024
# Objective

- Fixes bevyengine#15490 introduced in bevyengine#15094.

## Solution

- Use non-panicking `try_insert`

## Testing

- Closing window with `CursorIcon` no longer crashes after this change
(confirmed with `window_settings` example)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants