Diff between 3d0e48b33446567a7e02772bb84bd55c87073937 and 842c3dfabe83cc03d7612a3ec7e21dddde2b9165

Changed Files

File Additions Deletions Status
src/profile.c +6 -0 modified

Full Patch

diff --git a/src/profile.c b/src/profile.c
index 24f7b28..035994c 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);
 		}