summaryrefslogtreecommitdiff
path: root/tools/obex-server-tool.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2011-07-04 11:17:48 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-12-04 22:21:58 +0100
commit7afc5a6f90a729a458731f36c7d55a2de0c93c1e (patch)
treea37b595b8da00cda06b39f017c7fbc086a2aae13 /tools/obex-server-tool.c
parent0b362843b0b27db4d46b23295bb335431e64f332 (diff)
downloadbluez-7afc5a6f90a729a458731f36c7d55a2de0c93c1e.tar.gz
gobex: g_obex_new should create its own GIOChannel ref
Diffstat (limited to 'tools/obex-server-tool.c')
-rw-r--r--tools/obex-server-tool.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/obex-server-tool.c b/tools/obex-server-tool.c
index 3d93b92b4..b446a87e4 100644
--- a/tools/obex-server-tool.c
+++ b/tools/obex-server-tool.c
@@ -80,9 +80,12 @@ static gboolean unix_accept(GIOChannel *chan, GIOCondition cond, gpointer data)
cli_sk);
io = g_io_channel_unix_new(cli_sk);
+
g_io_channel_set_flags(io, G_IO_FLAG_NONBLOCK, NULL);
+ g_io_channel_set_close_on_unref(io, TRUE);
obex = g_obex_new(io, G_OBEX_TRANSPORT_STREAM, -1, -1);
+ g_io_channel_unref(io);
g_obex_set_disconnect_function(obex, disconn_func, NULL);
clients = g_slist_append(clients, obex);;