Skip to content

Fix get_handle_path() #1290

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/bevy_asset/src/asset_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ impl AssetServer {
}
})
.detach();
asset_path.into()
let owned_path = asset_path.to_owned();
let id: HandleId = asset_path.into();
self.server.handle_to_path.write().insert(id, owned_path);
id
Comment on lines +361 to +364
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as an addition to this, could we add a test to validate this behavior?

}

#[must_use = "not using the returned strong handles may result in the unexpected release of the assets"]
Expand Down