Skip to content

Commit c14588d

Browse files
Clarify retained TX frame lifetime
1 parent ccdc630 commit c14588d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

libcanard/canard.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ bool canard_new(canard_t* const self,
388388
const size_t filter_count);
389389

390390
/// The application MUST destroy all subscriptions before invoking this (this is asserted).
391+
/// The application MUST also release all retained TX frame views before invoking this.
391392
/// The TX queue will be purged automatically if not empty.
392393
void canard_destroy(canard_t* const self);
393394

@@ -422,7 +423,8 @@ bool canard_ingest_frame(canard_t* const self,
422423
const uint32_t extended_can_id,
423424
const canard_bytes_t can_data);
424425

425-
/// Retain a TX frame view obtained from tx() so it may outlive the callback. No effect if obj.data is NULL.
426+
/// Retain a TX frame view obtained from tx() so it may outlive the callback and the TX queue entry.
427+
/// The retained view must be released before canard_destroy() is invoked on the owning instance.
426428
/// This is not applicable to RX payload views.
427429
void canard_refcount_inc(const canard_bytes_t obj);
428430

0 commit comments

Comments
 (0)