diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-05-24 13:17:00 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-05-24 13:17:00 +0000 |
commit | 7e0db39d85c0540d683231c13b61b8bdc8ca6d4d (patch) | |
tree | 369eeeb6304ee1c9fd8153fc15ec9096f9260910 /serial | |
parent | dcc91e3ea4d987dc45b1d6451a8278d857c58d1d (diff) |
serial: close the file descriptor before release the RFCOMM device
Diffstat (limited to 'serial')
-rw-r--r-- | serial/port.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/serial/port.c b/serial/port.c index 22fc0129..c220110c 100644 --- a/serial/port.c +++ b/serial/port.c @@ -146,11 +146,12 @@ static void rfcomm_node_free(struct rfcomm_node *node) dbus_connection_unref(node->conn); if (node->owner) g_free(node->owner); - rfcomm_release(node->id); if (node->io) { g_source_remove(node->io_id); + g_io_channel_close(node->io); g_io_channel_unref(node->io); } + rfcomm_release(node->id); g_free(node); } @@ -173,9 +174,6 @@ static gboolean rfcomm_disconnect_cb(GIOChannel *io, { debug("RFCOMM node %s was disconnected", node->name); - if (cond & (G_IO_ERR | G_IO_HUP)) - g_io_channel_close(io); - name_listener_remove(node->conn, node->owner, (name_cb_t) connection_owner_exited, node); |