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