From d2399cad7afda578df4d1f70b9026cd0e5354274 Mon Sep 17 00:00:00 2001 From: YuanYuYuan Date: Mon, 13 Nov 2023 17:47:00 +0800 Subject: [PATCH] Refine the scouting termination (#571) --- examples/examples/z_scout.rs | 2 +- zenoh/src/scouting.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/examples/z_scout.rs b/examples/examples/z_scout.rs index 788d1b0578..10581dbaa1 100644 --- a/examples/examples/z_scout.rs +++ b/examples/examples/z_scout.rs @@ -36,5 +36,5 @@ async fn main() { .await; // stop scouting - drop(receiver); + receiver.stop(); } diff --git a/zenoh/src/scouting.rs b/zenoh/src/scouting.rs index 5b85a38359..ea09823ea1 100644 --- a/zenoh/src/scouting.rs +++ b/zenoh/src/scouting.rs @@ -220,7 +220,8 @@ impl ScoutInner { /// # }) /// ``` pub fn stop(self) { - // drop + // This drops the inner `stop_sender` and hence stops the scouting receiver + std::mem::drop(self); } }