fix: await the tasks after aborting them

This commit is contained in:
link2xt
2024-07-30 00:39:26 +00:00
parent c163438eaf
commit 490f41cda8
3 changed files with 29 additions and 11 deletions

View File

@@ -1913,8 +1913,13 @@ impl RecentlySeenLoop {
.unwrap();
}
pub(crate) fn abort(self) {
pub(crate) async fn abort(self) {
self.handle.abort();
// Await aborted task to ensure the `Future` is dropped
// with all resources moved inside such as the `Context`
// reference to `InnerContext`.
self.handle.await.ok();
}
}