Ejemplo n.º 1
0
SPAN_DECLARE(void) cfilter_delete(cfilter_t *cfi)
{
    if (cfi)
    {
        filter_delete(cfi->ref);
        filter_delete(cfi->imf);
    }
}
Ejemplo n.º 2
0
static Service* service_new(const char* name)
{
  DBusError error;
  Filter*   filter  = 0;
  Service*  service = 0;

  dbus_error_init(&error);

  service = g_new(Service, 1);

  if (!(filter = filter_new(service, service_handle_message))) {
    g_free(service);
    service = 0;
  }

  if (service) {
    if (dbus_bus_request_name(filter->connection, name, 0, &error) !=
        DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
    {
      dsme_log(LOG_DEBUG, "dbus_request_name(): %s\n", error.message);
      dbus_error_free(&error);
      g_free(service);
      service = 0;
      filter_delete(filter);
      filter = 0;
    }
  }

  if (service) {
    service->filter  = filter;
    service->name    = name;
    service->methods = dispatcher_list_new();
  }

  return service;
}