Skip to content

Commit

Permalink
impl Drop for MatchingListenerInner
Browse files Browse the repository at this point in the history
  • Loading branch information
p-avital committed Oct 13, 2023
1 parent f663dac commit b8ed7bf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions zenoh/src/publication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,16 @@ impl AsyncResolve for MatchingListenerUndeclaration<'_> {
}
}

#[zenoh_macros::unstable]
impl Drop for MatchingListenerInner<'_> {
fn drop(&mut self) {
self.alive = false;
if let Err(e) = self.publisher.session.matches_unsubscribe(self.state.id) {
log::error!("Failed to undeclare MatchingListener: {e}");
}
}
}

mod tests {
#[test]
fn priority_from() {
Expand Down

0 comments on commit b8ed7bf

Please sign in to comment.