mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 22:20:20 +00:00
fix asset loader preregistration for multiple assets (#9453)
# Objective fix #9452 when multiple assets are queued to a preregistered loader, only one gets unblocked when the real loader is registered. ## Solution i thought async_channel receivers worked like broadcast channels, but in fact the notification is only received by a single receiver, so only a single waiting asset is unblocked. close the sender instead so that all blocked receivers are unblocked.
This commit is contained in:
parent
e2ed42fd75
commit
8a8d43d224
1 changed files with 1 additions and 1 deletions
|
@ -236,7 +236,7 @@ impl AssetServer {
|
|||
loaders[existing_index] = MaybeAssetLoader::Ready(Arc::new(loader));
|
||||
if let Some(sender) = maybe_sender {
|
||||
// notify after replacing the loader
|
||||
let _ = sender.send_blocking(());
|
||||
let _ = sender.close();
|
||||
}
|
||||
} else {
|
||||
loaders.push(MaybeAssetLoader::Ready(Arc::new(loader)));
|
||||
|
|
Loading…
Reference in a new issue