Пример #1
0
void FcitxNotificationItemDestroy(void* arg)
{
    FcitxNotificationItem* notificationitem = (FcitxNotificationItem*) arg;
    if (notificationitem->conn) {
        dbus_connection_unregister_object_path(notificationitem->conn, NOTIFICATION_ITEM_DEFAULT_OBJ);
        dbus_connection_unregister_object_path(notificationitem->conn, "/MenuBar");
    }

    free(notificationitem);
}
Пример #2
0
static void profile_done(pa_bluetooth_backend *b, pa_bluetooth_profile_t profile) {
    pa_assert(b);

    switch (profile) {
        case PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT:
            dbus_connection_unregister_object_path(pa_dbus_connection_get(b->connection), HSP_AG_PROFILE);
            break;
        case PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY:
            dbus_connection_unregister_object_path(pa_dbus_connection_get(b->connection), HSP_HS_PROFILE);
            break;
        default:
            pa_assert_not_reached();
            break;
    }
}
Пример #3
0
/*!
 * \brief Carry out all actions to finalise the D-Bus connection.
 */
void
pcb_dbus_finish (void)
{
  DBusError err;

  // Initialise the error variable
  dbus_error_init (&err);

  // TODO: Could emit a "goodbye" signal here?

  dbus_connection_flush (pcb_dbus_conn);

  dbus_connection_unregister_object_path (pcb_dbus_conn,
					  PCB_DBUS_OBJECT_PATH);

  dbus_bus_release_name (pcb_dbus_conn, PCB_DBUS_CANONICAL_NAME, &err);

  dbus_error_free (&err);

  pcb_dbus_connection_finish_with_mainloop (pcb_dbus_conn);

  dbus_connection_close (pcb_dbus_conn);
  dbus_connection_unref (pcb_dbus_conn);

  // Call DBus shutdown. This doesn't work with shared connections,
  // only private ones (like we took out earlier).
  // If any future module / plugin to PCB wants to use DBus too,
  // we must remove this call. DBus will get shut-down when the app exits.
  dbus_shutdown ();
}
Пример #4
0
void DBus_InterpCleanup(Tcl_Interp *interp, DBusConnection *conn, char *path)
{
   char **entries, **entry, *newpath, *pathentry;
   Tcl_DBusHandlerData *data;

   dbus_connection_get_object_path_data(conn, path, (void **)&data);
   if (data != NULL) {
      if (DBus_HandlerCleanup(interp, data)) {
	 dbus_connection_unregister_object_path(conn, path);
	 ckfree((char *)data);
      }
   }
   dbus_connection_list_registered(conn, path, &entries);
   if (*entries != NULL) {
      newpath = ckalloc(strlen(path) + 256);
      strcpy(newpath, path);
      pathentry = newpath + strlen(path) - 1;
      if (*pathentry++ != '/') *pathentry++ = '/';
      for (entry = entries; *entry != NULL; entry++) {
	 strncpy(pathentry, *entry, 255);
	 /* Get a list of descendents from the child */
	 DBus_InterpCleanup(interp, conn, newpath);
      }
      ckfree(newpath);
   }
   /* Release the entries array */
   dbus_free_string_array(entries);
}
Пример #5
0
static void
cleanup_singleton (gpointer unused)
{
	g_return_if_fail (dbus_conn);
	if (object_registered)
		dbus_connection_unregister_object_path (dbus_conn, GNOME_KEYRING_DAEMON_PATH);
	object_registered = FALSE;
}
Пример #6
0
static int ldbus_connection_unregister_object_path(lua_State *L) {
	DBusConnection *connection = check_DBusConnection(L, 1);
	const char *path = luaL_checkstring(L, 2);
	if (!dbus_connection_unregister_object_path(connection, path)) {
		return luaL_error(L, LDBUS_NO_MEMORY);
	}
	lua_pushboolean(L, 1);
	return 1;
}
Пример #7
0
/**
 * wpas_dbus_ctrl_iface_deinit - Deinitialize dbus ctrl interface for
 * wpa_supplicant
 * @iface: Pointer to dbus private data from wpas_dbus_init()
 *
 * Deinitialize the dbus control interface that was initialized with
 * wpas_dbus_ctrl_iface_init().
 */
void wpas_dbus_ctrl_iface_deinit(struct wpas_dbus_priv *iface)
{
	if (!iface->dbus_new_initialized)
		return;
	wpa_printf(MSG_DEBUG, "dbus: Unregister D-Bus object '%s'",
		   WPAS_DBUS_NEW_PATH);
	dbus_connection_unregister_object_path(iface->con,
					       WPAS_DBUS_NEW_PATH);
}
Пример #8
0
void FcitxNotificationItemDestroy(void* arg)
{
    FcitxNotificationItem* notificationitem = (FcitxNotificationItem*) arg;
    if (notificationitem->conn) {
        dbus_connection_unregister_object_path(notificationitem->conn, NOTIFICATION_ITEM_DEFAULT_OBJ);
        dbus_connection_unregister_object_path(notificationitem->conn, "/MenuBar");
        dbus_connection_remove_filter(notificationitem->conn, FcitxNotificationItemDBusFilter, notificationitem);

        dbus_bus_remove_match(notificationitem->conn,
                           "type='signal',"
                           "interface='" DBUS_INTERFACE_DBUS "',"
                           "path='" DBUS_PATH_DBUS "',"
                           "member='NameOwnerChanged',"
                           "arg0='" NOTIFICATION_WATCHER_DBUS_ADDR "'",
                           NULL);
    }

    free(notificationitem);
}
Пример #9
0
void FcitxXkbDBusDestroy(void* arg)
{
    FcitxXkbDBus* xkbdbus = arg;

    if (xkbdbus->watcherId) {
        FcitxDBusUnwatchName(xkbdbus->owner, xkbdbus->watcherId);
    }

    if (xkbdbus->conn) {
        dbus_connection_unregister_object_path(xkbdbus->conn, FCITX_XKB_PATH);
    }

    if (xkbdbus->privconn) {
        dbus_connection_unregister_object_path(xkbdbus->privconn, FCITX_XKB_PATH);
    }

    FcitxIsoCodesFree(xkbdbus->isocodes);

    free(xkbdbus);
}
Пример #10
0
static void mafw_proxy_renderer_dispose (GObject *obj)
{
	MafwProxyRenderer *renderer_obj = MAFW_PROXY_RENDERER(obj);

	if (connection)
	{
		dbus_connection_unregister_object_path(connection,
				proxy_extension_return_path(renderer_obj));

		dbus_connection_unref(connection);
	}
}
void avahi_dbus_async_host_name_resolver_free(AsyncHostNameResolverInfo *i) {
    assert(i);

    if (i->host_name_resolver)
        avahi_s_host_name_resolver_free(i->host_name_resolver);
    dbus_connection_unregister_object_path(server->bus, i->path);
    AVAHI_LLIST_REMOVE(AsyncHostNameResolverInfo, async_host_name_resolvers, i->client->async_host_name_resolvers, i);

    i->client->n_objects--;
    assert(i->client->n_objects >= 0);

    avahi_free(i);
}
Пример #12
0
static jboolean tearDownNativeDataNative(JNIEnv *env, jobject object) {
    LOGV(__FUNCTION__);
#ifdef HAVE_BLUETOOTH
    native_data_t *nat =
        (native_data_t *)env->GetIntField(object, field_mNativeData);
    if (nat != NULL) {
        const char *device_agent_path =
            "/android/bluetooth/remote_device_agent";
        dbus_connection_unregister_object_path (nat->conn, device_agent_path);
    }
#endif /*HAVE_BLUETOOTH*/
    return JNI_TRUE;
}
Пример #13
0
static void mafw_proxy_playlist_finalize(GObject *object)
{
	MafwProxyPlaylist* playlist = MAFW_PROXY_PLAYLIST(object);
	MafwProxyPlaylistPrivate *priv;

	priv = MAFW_PROXY_PLAYLIST_GET_PRIVATE(playlist);

	dbus_connection_unregister_object_path(priv->connection,
                                               priv->obj_path);

	dbus_connection_unref(priv->connection);
	g_free(priv->obj_path);
}
Пример #14
0
void cras_dbus_control_stop()
{
	if (!dbus_control.conn)
		return;

	dbus_connection_unregister_object_path(dbus_control.conn,
					       CRAS_ROOT_OBJECT_PATH);

	dbus_connection_unref(dbus_control.conn);
	dbus_control.conn = NULL;
	cras_observer_remove(dbus_control.observer);
	dbus_control.observer = NULL;
}
Пример #15
0
static void
wsnamesFini (CompPlugin *p)
{
	freeDisplayPrivateIndex (displayPrivateIndex);

	bananaUnloadPlugin (bananaIndex);

	if (core.dbusConnection != NULL)
	{
		dbus_connection_unregister_object_path (core.dbusConnection,
		                                        "/org/fusilli/wsnames");
	}
}
void avahi_dbus_entry_group_free(EntryGroupInfo *i) {
    assert(i);

    if (i->entry_group)
        avahi_s_entry_group_free(i->entry_group);
    dbus_connection_unregister_object_path(server->bus, i->path);
    avahi_free(i->path);
    AVAHI_LLIST_REMOVE(EntryGroupInfo, entry_groups, i->client->entry_groups, i);

    i->client->n_objects--;
    assert(i->client->n_objects >= 0);
    
    avahi_free(i);
}
void avahi_dbus_domain_browser_free(DomainBrowserInfo *i) {
    assert(i);

    if (i->domain_browser)
        avahi_s_domain_browser_free(i->domain_browser);
    dbus_connection_unregister_object_path(server->bus, i->path);
    avahi_free(i->path);
    AVAHI_LLIST_REMOVE(DomainBrowserInfo, domain_browsers, i->client->domain_browsers, i);

    i->client->n_objects--;
    assert(i->client->n_objects >= 0);

    avahi_free(i);
}
void avahi_dbus_service_type_browser_free(ServiceTypeBrowserInfo *i) {
    assert(i);

    if (i->service_type_browser)
        avahi_s_service_type_browser_free(i->service_type_browser);
    dbus_connection_unregister_object_path(server->bus, i->path);
    avahi_free(i->path);
    AVAHI_LLIST_REMOVE(ServiceTypeBrowserInfo, service_type_browsers, i->client->service_type_browsers, i);

    i->client->n_objects--;
    assert(i->client->n_objects >= 0);

    avahi_free(i);
}
Пример #19
0
void pcb_dbus_finish( void )
{
  DBusError err;
  dbus_error_init( err.name );
  dbus_connection_flush( &pcb_dbus_conn );
  dbus_connection_unregister_object_path( &pcb_dbus_conn, "/org/seul/geda/pcb" );
  dbus_bus_release_name( &pcb_dbus_conn, "org.seul.geda.pcb", err.name );
  dbus_error_free( err.name );
  pcb_dbus_connection_finish_with_mainloop( &pcb_dbus_conn );
  dbus_connection_close( &pcb_dbus_conn );
  dbus_connection_unref( &pcb_dbus_conn );
  dbus_shutdown( );
  return;
}
Пример #20
0
static void mafw_proxy_source_dispose (GObject *obj)
{
	MafwProxySource *source_obj = MAFW_PROXY_SOURCE(obj);

	if (connection)
	{
		dbus_connection_unregister_object_path(connection,
				proxy_extension_return_path(source_obj));

		dbus_connection_unref(connection);
	}
	if (source_obj->priv->browse_requests)
		g_hash_table_destroy(source_obj->priv->browse_requests);
}
Пример #21
0
void pa_dbusobj_server_lookup_free(pa_dbusobj_server_lookup *sl) {
    pa_assert(sl);

    if (sl->path_registered) {
        pa_assert(sl->conn);
        if (!dbus_connection_unregister_object_path(pa_dbus_connection_get(sl->conn), OBJECT_PATH))
            pa_log_debug("dbus_connection_unregister_object_path() failed for " OBJECT_PATH ".");
    }

    if (sl->conn)
        pa_dbus_connection_unref(sl->conn);

    pa_xfree(sl);
}
Пример #22
0
void
pre_disconnect_hook(void)
{
    DBusError error;

    dbus_error_init(&error);
    dbus_connection_unregister_object_path(connection_data->connection,
                                           connection_data->busobject);
    dbus_bus_remove_match(connection_data->connection, MATCH_RULE,
                          &error);
    dbus_bus_release_name(connection_data->connection,
                          connection_data->busname, &error);
    dbus_error_free(&error);
}
Пример #23
0
void
gconf_database_dbus_teardown (GConfDatabase *db)
{
  DBusConnection *conn;

  conn = gconfd_dbus_get_connection ();

  dbus_connection_unregister_object_path (conn, db->object_path);
  
  dbus_connection_remove_filter (conn,
				 (DBusHandleMessageFunction)database_filter_func,
				 db);
  g_free (db->object_path);
  db->object_path = NULL;
}
Пример #24
0
void avahi_dbus_record_browser_free(RecordBrowserInfo *i) {
    assert(i);

    if (i->record_browser)
        avahi_s_record_browser_free(i->record_browser);

    if (i->path) {
        dbus_connection_unregister_object_path(server->bus, i->path);
        avahi_free(i->path);
    }
    AVAHI_LLIST_REMOVE(RecordBrowserInfo, record_browsers, i->client->record_browsers, i);

    assert(i->client->n_objects >= 1);
    i->client->n_objects--;

    avahi_free(i);
}
static void cleanupNative(JNIEnv* env, jobject object) {
#ifdef HAVE_BLUETOOTH
    LOGV("%s", __FUNCTION__);
    native_data_t *nat =
            (native_data_t *)env->GetIntField(object, field_mNativeData);
    if (nat) {
        if (!dbus_connection_unregister_object_path (nat->conn, GATT_CLIENT_WATCHER_PATH)) {
            LOGE("%s: Can't unregister object path %s for GATT Client watcher!",
                  __FUNCTION__, GATT_CLIENT_WATCHER_PATH);
        }

        dbus_connection_close(nat->conn);
        env->DeleteGlobalRef(nat->me);
        free(nat);
        nat = NULL;
    }
#endif
}
Пример #26
0
static void
server_handle_shutdown (DBusConnection *connection, DBusMessage *message)
{
  DBusMessage *reply;

  if (gconfd_dbus_check_in_shutdown (connection, message))
    return;

  gconf_log(GCL_DEBUG, _("Shutdown request received"));

  reply = dbus_message_new_method_return (message);
  dbus_connection_send (connection, reply, NULL);
  dbus_message_unref (reply);
  
  dbus_connection_unregister_object_path (connection, server_path);

  gconfd_main_quit();
}
static void object_path_unref(DBusConnection *connection, const char *path)
{
	struct generic_data *data = NULL;
	LOG("object_path_unref");
	if (dbus_connection_get_object_path_data(connection, path,
						(void *) &data) == FALSE)
		return;

	if (data == NULL)
		return;

	data->refcount--;

	if (data->refcount > 0)
		return;

	dbus_connection_unregister_object_path(data->conn, data->path);
}
Пример #28
0
gboolean
ibus_connection_unregister_object_path (IBusConnection *connection, const gchar *path)
{
    g_assert (IBUS_IS_CONNECTION (connection));
    g_assert (path != NULL);

    IBusConnectionPrivate *priv;
    priv = IBUS_CONNECTION_GET_PRIVATE (connection);

    gboolean retval;

    retval = dbus_connection_unregister_object_path (priv->connection, path);
    if (!retval) {
        g_warning ("Out of memory!");
        return FALSE;
    }

    return TRUE;
}
Пример #29
0
/**
 * wrapper_unexport:
 * @comp: the extension to unexport.
 *
 * De-registers the given component from D-Bus, frees data structures for
 * which it's responsible.
 */
static void wrapper_unexport(gpointer comp)
{
	DBusError err;
	GList *node;
	ExportedComponent *ecomp;

	ecomp = NULL;
	for (node = Exports; node; node = node->next) {
		ecomp = (ExportedComponent *)node->data;
		if (ecomp->comp == comp)
			break;
	}
	if (!ecomp)
		return;

	dbus_connection_unregister_object_path(Session_bus, ecomp->object_path);

	dbus_error_init(&err);
	switch (dbus_bus_release_name(Session_bus, ecomp->service_name, &err)){
	case DBUS_RELEASE_NAME_REPLY_NOT_OWNER:
	case DBUS_RELEASE_NAME_REPLY_NON_EXISTENT:
		g_warning("dbus_bus_release_name() failed, either "
			  "'%s' is non-existent, or we are not the owners",
			  ecomp->service_name);
		break;
	default:
		if (dbus_error_is_set(&err)) {
			g_warning("dbus_bus_release_name() an error was set: "
				  "%s", err.message);
			dbus_error_free(&err);
		}
	}
	disconnect_sighandlers(ecomp);
	g_free(ecomp->service_name);
	g_free(ecomp->object_path);
	ecomp->object_path = NULL;
	g_free(ecomp->name);
	g_free(ecomp->uuid);
	g_free(ecomp);
	Exports = g_list_delete_link(Exports, node);
	extension_deregister(comp);
}
/**
 * wpa_dbus_unregister_object_per_iface - Unregisters DBus object
 * @ctrl_iface: Pointer to dbus private data
 * @path: DBus path to object which will be unregistered
 * Returns: Zero on success and -1 on failure
 *
 * Unregisters DBus object given by its path
 */
int wpa_dbus_unregister_object_per_iface(
	struct wpas_dbus_priv *ctrl_iface, const char *path)
{
	DBusConnection *con = ctrl_iface->con;
	struct wpa_dbus_object_desc *obj_desc = NULL;

	dbus_connection_get_object_path_data(con, path, (void **) &obj_desc);
	if (!obj_desc) {
		wpa_printf(MSG_ERROR, "dbus: %s: Could not obtain object's "
			   "private data: %s", __func__, path);
	} else {
		eloop_cancel_timeout(flush_object_timeout_handler, con,
				     obj_desc);
	}

	if (!dbus_connection_unregister_object_path(con, path))
		return -1;

	return 0;
}