From 25afc21cba0a451097c4def7416fd22ddee7b607 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 12 Jan 2015 10:58:16 -0200 Subject: attrib: Fix not disconnecting The default behavior of GAttrib is to disconnect on unref but patch 0ea75ab4bb3ff96a50785cf2b9860011c49fd7b7 had changed that in order to fix a warning, this return the old behavior but leaves to bt_att to do the actual closing. --- attrib/gattrib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'attrib') diff --git a/attrib/gattrib.c b/attrib/gattrib.c index 82a6133c0..c36a207b7 100644 --- a/attrib/gattrib.c +++ b/attrib/gattrib.c @@ -108,7 +108,6 @@ GAttrib *g_attrib_new(GIOChannel *io, guint16 mtu) if (!attr) return NULL; - g_io_channel_set_close_on_unref(io, FALSE); g_io_channel_ref(io); attr->io = io; @@ -116,6 +115,9 @@ GAttrib *g_attrib_new(GIOChannel *io, guint16 mtu) if (!attr->att) goto fail; + bt_att_set_close_on_unref(attr->att, true); + g_io_channel_set_close_on_unref(io, FALSE); + if (!bt_att_set_mtu(attr->att, mtu)) goto fail; -- cgit v1.2.1