diff --git a/zenoh/src/net/runtime/mod.rs b/zenoh/src/net/runtime/mod.rs index aca6734d4..40f241df8 100644 --- a/zenoh/src/net/runtime/mod.rs +++ b/zenoh/src/net/runtime/mod.rs @@ -459,7 +459,6 @@ impl TransportPeerEventHandler for RuntimeSession { fn closing(&self) { self.main_handler.closing(); - Runtime::closing_session(self); for handler in &self.slave_handlers { handler.closing(); } @@ -467,6 +466,7 @@ impl TransportPeerEventHandler for RuntimeSession { fn closed(&self) { self.main_handler.closed(); + Runtime::closed_session(self); for handler in &self.slave_handlers { handler.closed(); } diff --git a/zenoh/src/net/runtime/orchestrator.rs b/zenoh/src/net/runtime/orchestrator.rs index faadf5eb5..9118e6466 100644 --- a/zenoh/src/net/runtime/orchestrator.rs +++ b/zenoh/src/net/runtime/orchestrator.rs @@ -1180,7 +1180,7 @@ impl Runtime { } } - pub(super) fn closing_session(session: &RuntimeSession) { + pub(super) fn closed_session(session: &RuntimeSession) { if session.runtime.is_closed() { return; }