Docs: relayd: live: clarify ownership of vstream after viewer release
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 19 Jan 2022 19:35:25 +0000 (14:35 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 19 Jan 2022 19:35:33 +0000 (14:35 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I2b0a838bb72bec1ec693ee0c722b748105d7280c

src/bin/lttng-relayd/live.cpp

index e3d27b1ef8411a1a6efc837ffa10051d6108155f..d963a69b4c1870d901f5fa6fb9b2ba58efa8a811 100644 (file)
@@ -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;
This page took 0.039632 seconds and 4 git commands to generate.