summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-03-23 17:31:40 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2009-03-23 17:31:40 +0200
commit44f054fa224dd19de7adb0eb365b261b4cc425f5 (patch)
tree9a058dad57f249616c80a8bd2bd4b890941142de
parentabdf12d1ad67ab373247036eb9efdb48aff9a9c3 (diff)
Be sure to remove the name listener in serial_port_free
-rw-r--r--serial/port.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/serial/port.c b/serial/port.c
index 4946e158..43a94471 100644
--- a/serial/port.c
+++ b/serial/port.c
@@ -170,8 +170,14 @@ static int port_release(struct serial_port *port)
static void serial_port_free(struct serial_port *port)
{
+ struct serial_device *device = port->device;
+
+ if (device && port->listener_id > 0)
+ g_dbus_remove_watch(device->conn, port->listener_id);
+
if (port->id >= 0)
port_release(port);
+
g_free(port->uuid);
g_free(port);
}