From 842c3dfabe83cc03d7612a3ec7e21dddde2b9165 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 1 Oct 2012 13:11:57 +0300 Subject: [PATCH] core: Track probed adapters for profiles --- src/profile.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/profile.c b/src/profile.c index 24f7b28aa..035994c79 100644 --- a/src/profile.c +++ b/src/profile.c @@ -71,6 +71,7 @@ struct ext_io { int proto; GIOChannel *io; guint io_id; + struct btd_adapter *adapter; bool authorizing; DBusPendingCall *new_conn; @@ -166,6 +167,9 @@ static void ext_io_destroy(gpointer p) ext_cancel(ext); } + if (ext_io->adapter) + btd_adapter_unref(ext_io->adapter); + g_free(ext_io); } @@ -454,6 +458,7 @@ static int ext_start_servers(struct ext_profile *ext, } else { server->io = io; server->proto = BTPROTO_L2CAP; + server->adapter = btd_adapter_ref(adapter); ext->servers = g_slist_append(ext->servers, server); DBG("%s listening on PSM %u", ext->name, ext->psm); } @@ -476,6 +481,7 @@ static int ext_start_servers(struct ext_profile *ext, } else { server->io = io; server->proto = BTPROTO_RFCOMM; + server->adapter = btd_adapter_ref(adapter); ext->servers = g_slist_append(ext->servers, server); DBG("%s listening on chan %u", ext->name, ext->chan); } -- 2.47.3