Diff between 2874ef9574923716c710862e85a4ab907ba44213 and cceb761559fc97c2a066fb943b2f0f46fcfddc6a

Changed Files

File Additions Deletions Status
obexd/client/session.c +9 -0 modified

Full Patch

diff --git a/obexd/client/session.c b/obexd/client/session.c
index bdd55d3..3143cc0 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -783,6 +783,12 @@ static DBusMessage *close_session(DBusConnection *connection,
 	return dbus_message_new_method_return(message);
 }
 
+static void owner_disconnected(DBusConnection *connection, void *user_data)
+{
+	struct session_data *session = user_data;
+
+	session_shutdown(session);
+}
 
 static GDBusMethodTable session_methods[] = {
 	{ "GetProperties",	"", "a{sv}",	get_properties	},
@@ -1439,6 +1445,9 @@ int session_register(struct session_data *session)
 		return -EIO;
 	}
 
+	g_dbus_add_disconnect_watch(session->conn, session->owner,
+				owner_disconnected, session, NULL);
+
 	session_ref(session);
 
 	return 0;