X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=f6c44d3be16e63096e856874344dd39e11b4d348;hb=b5893d8e91f64257e58a50c7f5b413a5b31cf076;hp=10a6de39168c73d68766f92f0b8a3003707b564c;hpb=c8f61fd42dad6e45ff82402089f99af568de5984;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 10a6de391..f6c44d3be 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -3171,7 +3171,11 @@ int cmd_destroy_session(struct ltt_session *session, if (session->most_recent_chunk_id.is_set && session->most_recent_chunk_id.value != 0 && - session->current_trace_chunk) { + session->current_trace_chunk && session->output_traces) { + /* + * Perform a last rotation on destruction if rotations have + * occurred during the session's lifetime. + */ ret = cmd_rotate_session(session, NULL); if (ret != LTTNG_OK) { ERR("Failed to perform an implicit rotation as part of the destruction of session \"%s\": %s",