From 4928b11750c3b0e7d51662675ff6dc57a929dfb2 Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Thu, 9 Nov 2023 12:17:01 +0100 Subject: [PATCH] Add z_drop for liveliness --- examples/z_liveliness.c | 4 ++-- include/zenoh_macros.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/z_liveliness.c b/examples/z_liveliness.c index 9b9a0965c..b21cc40bc 100644 --- a/examples/z_liveliness.c +++ b/examples/z_liveliness.c @@ -66,11 +66,11 @@ int main(int argc, char **argv) { sleep(1); } else if (c == 'd') { printf("Undeclaring liveliness token...\n"); - zc_liveliness_undeclare_token(&token); + z_drop(z_move(token)); } } - zc_liveliness_undeclare_token(z_move(token)); + z_drop(z_move(token)); z_close(z_move(s)); return 0; } diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 4bb00e95e..2a2c23e51 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -37,7 +37,8 @@ z_owned_reply_channel_t * : z_reply_channel_drop, \ zc_owned_payload_t * : zc_payload_drop, \ zc_owned_shmbuf_t * : zc_shmbuf_drop, \ - zc_owned_shm_manager_t * : zc_shm_manager_drop \ + zc_owned_shm_manager_t * : zc_shm_manager_drop, \ + zc_owned_liveliness_token_t * : zc_liveliness_undeclare_token \ )(x) #define z_null(x) (*x = \