Browse Source

devicechannel: check if streams are non null before calling close()

bboozzoo/device-cache
Maciek Borzecki 10 years ago
parent
commit
7c3dc91074
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      src/devicechannel.vala

+ 6
- 3
src/devicechannel.vala View File

@ -99,17 +99,20 @@ class DeviceChannel : Object {
}
try {
_din.close();
if (_din != null)
_din.close();
} catch (Error e) {
critical("failed to close data input: %s", e.message);
}
try {
_dout.close();
if (_dout != null)
_dout.close();
} catch (Error e) {
critical("failed to close data output: %s", e.message);
}
try {
_conn.close();
if (_conn != null)
_conn.close();
} catch (Error e) {
critical("failed to close connection: %s", e.message);
}


Loading…
Cancel
Save