From: Jérémie Galarneau Date: Wed, 19 Jan 2022 19:35:25 +0000 (-0500) Subject: Docs: relayd: live: clarify ownership of vstream after viewer release X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=8f141dbdf7c4628c13d7b099240a7bd4bcacf2cf;p=deliverable%2Flttng-tools.git Docs: relayd: live: clarify ownership of vstream after viewer release Signed-off-by: Jérémie Galarneau Change-Id: I2b0a838bb72bec1ec693ee0c722b748105d7280c --- diff --git a/src/bin/lttng-relayd/live.cpp b/src/bin/lttng-relayd/live.cpp index e3d27b1ef..d963a69b4 100644 --- a/src/bin/lttng-relayd/live.cpp +++ b/src/bin/lttng-relayd/live.cpp @@ -2093,9 +2093,16 @@ int viewer_get_metadata(struct relay_connection *conn) */ if (vstream->metadata_sent > 0) { if (vstream->stream->closed && vstream->stream->no_new_metadata_notified) { - /* Release ownership for the viewer metadata stream. */ + /* + * Release ownership for the viewer metadata + * stream. Note that this reference is the + * viewer's reference. The vstream still exists + * until the end of the function as + * viewer_stream_get_by_id() took a reference. + */ viewer_stream_put(vstream); } + vstream->stream->no_new_metadata_notified = true; } goto send_reply;