pthread_mutex_unlock(&session->viewer_ready_lock);
ret = stream_close(session, stream);
- if (!ret) {
+ if (ret || session->snapshot) {
/* Already close thus the ctf trace is being or has been destroyed. */
goto end;
}
cds_lfht_for_each_entry(relay_streams_ht->ht, &iter.iter, stream,
node.node) {
if (stream->session_id == session_id &&
- !stream->data_pending_check_done) {
+ !stream->data_pending_check_done && !stream->terminated_flag) {
is_data_inflight = 1;
DBG("Data is still in flight for stream %" PRIu64,
stream->stream_handle);