Skip to content

Commit b1b9d76

Browse files
authored
Fix tasks on wasm (#21096)
# Objective Fix #21079. This was caused by incorrectly dropping a future. ## Solution Await the future instead of dropping it. ## Testing See #21079 (comment). @rparrett has indicated this resolves the issue. I have not personally tested it. We need to figure out a better solution to unit test the web. This would be very easy to test, except that it requires `web_bindgen_futures` and has to run in a browser environment.
1 parent 6f236bf commit b1b9d76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_tasks/src/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cfg::web! {
3939
// Catch any panics that occur when polling the future so they can
4040
// be propagated back to the task handle.
4141
let value = CatchUnwind(AssertUnwindSafe(future)).await;
42-
let _ = sender.send(value);
42+
let _ = sender.send(value).await;
4343
});
4444
Self(receiver)
4545
}

0 commit comments

Comments
 (0)