Skip to content

Commit

Permalink
fix: set attachment_drop as a private function
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Apr 25, 2024
1 parent a7f0690 commit 7618d83
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/zenoh-pico/protocol/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ size_t _z_attachment_estimate_length(z_attachment_t att);
/**
* Drop an attachment that was decoded from a received message
*/
void z_attachment_drop(z_attachment_t *att);
void _z_attachment_drop(z_attachment_t *att);
#endif

_z_timestamp_t _z_timestamp_duplicate(const _z_timestamp_t *tstamp);
Expand Down
2 changes: 1 addition & 1 deletion src/net/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void _z_sample_clear(_z_sample_t *sample) {
_z_bytes_clear(&sample->encoding.schema); // FIXME: call the z_encoding_clear
_z_timestamp_clear(&sample->timestamp);
#if Z_FEATURE_ATTACHMENT == 1
z_attachment_drop(&sample->attachment);
_z_attachment_drop(&sample->attachment);
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion src/net/query.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void _z_query_clear(_z_query_t *q) {
_z_keyexpr_clear(&q->_key);
_z_value_clear(&q->_value);
#if Z_FEATURE_ATTACHMENT == 1
z_attachment_drop(&q->attachment);
_z_attachment_drop(&q->attachment);
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion src/protocol/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int8_t z_attachment_iterate(z_attachment_t this_, z_attachment_iter_body_t body,
return this_.iteration_driver(this_.data, body, ctx);
}

void z_attachment_drop(z_attachment_t *att) {
void _z_attachment_drop(z_attachment_t *att) {
if (att->iteration_driver == _z_encoded_attachment_iteration_driver) {
_z_bytes_clear((z_bytes_t *)att->data);
z_free((z_bytes_t *)att->data);
Expand Down
2 changes: 1 addition & 1 deletion src/session/subscription.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ int8_t _z_trigger_subscriptions(_z_session_t *zn, const _z_keyexpr_t keyexpr, co
sub->in->val._callback(&s, sub->in->val._arg);
xs = _z_subscription_rc_list_tail(xs);
}
z_attachment_drop(&s.attachment);
_z_attachment_drop(&s.attachment);
_z_keyexpr_clear(&key);
_z_subscription_rc_list_free(&subs);
} else {
Expand Down

0 comments on commit 7618d83

Please sign in to comment.