summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/isode/stroke/network/JavaConnection.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/isode/stroke/network/JavaConnection.java b/src/com/isode/stroke/network/JavaConnection.java
index 2069e33..31b07a0 100644
--- a/src/com/isode/stroke/network/JavaConnection.java
+++ b/src/com/isode/stroke/network/JavaConnection.java
@@ -131,11 +131,16 @@ public class JavaConnection extends Connection implements EventOwner {
} finally {
if(socketChannel_ != null) {
try {
- socketChannel_.close();
- selector_.close();
+ socketChannel_.close();
} catch (IOException ex) {
/* Do we need to return an error if we're already trying to close? */
}
+ if(selector_ != null) {
+ try {
+ selector_.close();
+ } catch (IOException e) {
+ }
+ }
}
}
}