summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Johnson <mjj29@hecate.matthew.ath.cx>2008-06-12 19:03:10 +0100
committerMatthew Johnson <mjj29@hecate.matthew.ath.cx>2008-06-12 19:03:10 +0100
commit8701b17fdb6465b64c86b070f51cce00cc1155a1 (patch)
tree1e165534616740aeadf75e4082db982d08fbf07b
parent930fabddaad8ee78afa095131695e45eb89f858b (diff)
fix stale threads being left over
-rw-r--r--org/freedesktop/dbus/AbstractConnection.java3
-rw-r--r--org/freedesktop/dbus/DBusConnection.java2
2 files changed, 4 insertions, 1 deletions
diff --git a/org/freedesktop/dbus/AbstractConnection.java b/org/freedesktop/dbus/AbstractConnection.java
index 219ad00..5cdc27e 100644
--- a/org/freedesktop/dbus/AbstractConnection.java
+++ b/org/freedesktop/dbus/AbstractConnection.java
@@ -577,7 +577,8 @@ public abstract class AbstractConnection
// disconnect from the trasport layer
try {
- transport.disconnect();
+ if (null != transport)
+ transport.disconnect();
} catch (IOException IOe) {
if (EXCEPTION_DEBUG && Debug.debug) Debug.print(Debug.ERR, IOe);
}
diff --git a/org/freedesktop/dbus/DBusConnection.java b/org/freedesktop/dbus/DBusConnection.java
index 6af864a..c2d36ed 100644
--- a/org/freedesktop/dbus/DBusConnection.java
+++ b/org/freedesktop/dbus/DBusConnection.java
@@ -159,9 +159,11 @@ public class DBusConnection extends AbstractConnection
transport = new Transport(addr, AbstractConnection.TIMEOUT);
} catch (IOException IOe) {
if (EXCEPTION_DEBUG && Debug.debug) Debug.print(Debug.ERR, IOe);
+ disconnect();
throw new DBusException(_("Failed to connect to bus ")+IOe.getMessage());
} catch (ParseException Pe) {
if (EXCEPTION_DEBUG && Debug.debug) Debug.print(Debug.ERR, Pe);
+ disconnect();
throw new DBusException(_("Failed to connect to bus ")+Pe.getMessage());
}