Skip to content

Commit c9e5f82

Browse files
committed
mctp-estack: Fix RouterAsyncReqChannel::async_drop
Warning was printed when async_drop() was called, since the tag wasn't cleared. Signed-off-by: Matt Johnston <[email protected]>
1 parent 3f248ef commit c9e5f82

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mctp-estack/src/router.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -728,11 +728,13 @@ impl<'r> RouterAsyncReqChannel<'r> {
728728

729729
/// This must be called prior to drop whenever `tag_noexpire()` is used.
730730
///
731-
/// A workaround until async drop is implemented in Rust itself.
731+
/// Failure to call will result in leaking tags in the Router.
732+
///
733+
/// This is a workaround until async drop is implemented in Rust itself.
732734
/// <https://github.com/rust-lang/rust/issues/126482>
733-
pub async fn async_drop(self) {
735+
pub async fn async_drop(mut self) {
734736
if !self.tag_expires {
735-
if let Some(tag) = self.sent_tag {
737+
if let Some(tag) = self.sent_tag.take() {
736738
self.router.app_release_tag(self.eid, tag).await;
737739
}
738740
}

0 commit comments

Comments
 (0)