Exemplo n.º 1
0
gboolean
log_dest_driver_deinit_method(LogPipe *s)
{
  LogDestDriver *self = (LogDestDriver *) s;
  GList *l, *l_next;

  for (l = self->queues; l; l = l_next)
    {
      LogQueue *q = (LogQueue *) l->data;

      /* the GList struct will be freed by log_dest_driver_release_queue */
      l_next = l->next;

      /* we have to pass a reference to log_dest_driver_release_queue(),
       * which automatically frees the ref on the list too */
      log_dest_driver_release_queue(self, log_queue_ref(q));
    }
  g_assert(self->queues == NULL);

  stats_lock();
  stats_unregister_counter(SCS_DESTINATION | SCS_GROUP, self->super.group, NULL, SC_TYPE_PROCESSED, &self->super.processed_group_messages);
  stats_unregister_counter(SCS_CENTER, NULL, "queued", SC_TYPE_PROCESSED, &self->queued_global_messages);
  stats_unlock();

  if (!log_driver_deinit_method(s))
    return FALSE;
  return TRUE;
}
Exemplo n.º 2
0
gboolean
log_dest_driver_deinit_method(LogPipe *s)
{
    LogDestDriver *self = (LogDestDriver *) s;
    GList *l, *l_next;

    for (l = self->queues; l; l = l_next)
    {
        LogQueue *q = (LogQueue *) l->data;

        /* the GList struct will be freed by log_dest_driver_release_queue */
        l_next = l->next;

        /* we have to pass a reference to log_dest_driver_release_queue(),
         * which automatically frees the ref on the list too */
        log_dest_driver_release_queue(self, log_queue_ref(q));
    }
    g_assert(self->queues == NULL);

    if (!log_driver_deinit_method(s))
        return FALSE;
    return TRUE;
}