mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +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
5b0798f029
commit
ef88c3b2bd
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