summaryrefslogtreecommitdiff
path: root/attrib
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-01-12 10:58:16 -0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-01-12 10:58:16 -0200
commit25afc21cba0a451097c4def7416fd22ddee7b607 (patch)
treefae41d4b67e155f36b1700997bb6e990d7bf712d /attrib
parentb9dbc3762b5ec0a7b62497866cd0d5bab4433ee0 (diff)
downloadbluez-25afc21cba0a451097c4def7416fd22ddee7b607.tar.gz
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.
Diffstat (limited to 'attrib')
-rw-r--r--attrib/gattrib.c4
1 files changed, 3 insertions, 1 deletions
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;