From b047b98a81cba81442bfb03c8baad7edff4a3f5d Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Mon, 19 Jan 2015 21:13:40 +0100 Subject: [PATCH] device: clear host address on disconnect --- src/device.vala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/device.vala b/src/device.vala index 7e84d39..eb4b741 100644 --- a/src/device.vala +++ b/src/device.vala @@ -140,6 +140,7 @@ class Device : Object { if (_channel != null) _channel.close.begin(); _channel = null; + _host = null; } /** @@ -225,8 +226,13 @@ class Device : Object { paired(is_paired); } - private void handle_disconnect() { + private async void handle_disconnect() { // channel got disconnected debug("channel disconnected"); + yield _channel.close(); + _channel = null; + _host = null; + // emit disconnected + disconnected(); } } \ No newline at end of file