Skip to content

Commit d4b065d

Browse files
committed
release the state lock before executing callbacks
1 parent d956ffd commit d4b065d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

zenoh/src/api/session.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3272,7 +3272,7 @@ impl Closee for Arc<SessionInner> {
32723272
// will be stabilized.
32733273
let mut state = zwrite!(self.state);
32743274
let _matching_listeners = std::mem::take(&mut state.matching_listeners);
3275-
state.closing_callbacks.close();
3275+
let _closing_callbacks = std::mem::take(&mut state.closing_callbacks);
32763276
drop(state);
32773277
}
32783278
}
@@ -3310,8 +3310,10 @@ impl ClosingCallbackList {
33103310
self.callbacks.remove(id.index);
33113311
}
33123312
}
3313+
}
33133314

3314-
fn close(&mut self) {
3315+
impl Drop for ClosingCallbackList {
3316+
fn drop(&mut self) {
33153317
for cb in self.callbacks.drain() {
33163318
(cb.callback)();
33173319
}

0 commit comments

Comments
 (0)