Reference count ltt_session objects
[lttng-tools.git] / src / bin / lttng-sessiond / rotation-thread.c
index 3e06e93110801116d2441b59a0b1ddc13b3650ae..a9f9967a3b49ee04d3fab5beba7b3d27c268c627 100644 (file)
@@ -706,7 +706,6 @@ int handle_job_queue(struct rotation_thread_handle *handle,
 {
        int ret = 0;
        int fd = lttng_pipe_get_readfd(queue->event_pipe);
-       struct ltt_session *session;
        char buf;
 
        ret = lttng_read(fd, &buf, 1);
@@ -717,6 +716,7 @@ int handle_job_queue(struct rotation_thread_handle *handle,
        }
 
        for (;;) {
+               struct ltt_session *session;
                struct rotation_thread_job *job;
 
                /* Take the queue lock only to pop an element from the list. */
@@ -747,12 +747,14 @@ int handle_job_queue(struct rotation_thread_handle *handle,
                         */
                        session_unlock_list();
                        free(job);
+                       session_put(session);
                        continue;
                }
 
                session_lock(session);
                ret = run_job(job, session, handle->notification_thread_handle);
                session_unlock(session);
+               session_put(session);
                session_unlock_list();
                free(job);
                if (ret) {
@@ -841,6 +843,7 @@ int handle_condition(const struct lttng_condition *condition,
 
 end_unlock:
        session_unlock(session);
+       session_put(session);
 end:
        return ret;
 }
@@ -860,7 +863,7 @@ int handle_notification_channel(int fd,
        status = lttng_notification_channel_has_pending_notification(
                        rotate_notification_channel, &notification_pending);
        if (status != LTTNG_NOTIFICATION_CHANNEL_STATUS_OK) {
-               ERR("[rotation-thread ]Error occured while checking for pending notification");
+               ERR("[rotation-thread ]Error occurred while checking for pending notification");
                ret = -1;
                goto end;
        }
@@ -978,7 +981,7 @@ void *thread_rotation(void *data)
                                ret = handle_notification_channel(fd, handle,
                                                &thread);
                                if (ret) {
-                                       ERR("[rotation-thread] Error occured while handling activity on notification channel socket");
+                                       ERR("[rotation-thread] Error occurred while handling activity on notification channel socket");
                                        goto error;
                                }
                        }
This page took 0.042113 seconds and 4 git commands to generate.