mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-03 17:14:21 +08:00
obexd: Removes the disconnect watch when the session is freed
This commit is contained in:
parent
f97b09d4e3
commit
ea811042ef
@ -72,6 +72,9 @@ static void session_unref(struct session_data *session)
|
||||
if (g_atomic_int_dec_and_test(&session->refcount) == FALSE)
|
||||
return;
|
||||
|
||||
if (session->agent_watch)
|
||||
g_dbus_remove_watch(session->conn, session->agent_watch);
|
||||
|
||||
if (session->agent_name != NULL) {
|
||||
DBusMessage *message;
|
||||
|
||||
@ -598,7 +601,7 @@ static DBusMessage *assign_agent(DBusConnection *connection,
|
||||
session->agent_name = g_strdup(sender);
|
||||
session->agent_path = g_strdup(path);
|
||||
|
||||
g_dbus_add_disconnect_watch(connection, sender,
|
||||
session->agent_watch = g_dbus_add_disconnect_watch(connection, sender,
|
||||
agent_disconnected, session, NULL);
|
||||
|
||||
return dbus_message_new_method_return(message);
|
||||
|
@ -49,6 +49,7 @@ struct session_data {
|
||||
gchar *filename;
|
||||
gchar *agent_name;
|
||||
gchar *agent_path;
|
||||
guint agent_watch;
|
||||
GPtrArray *pending;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user