diff --git a/apps/streaming/java/src/net/i2p/client/streaming/Connection.java b/apps/streaming/java/src/net/i2p/client/streaming/Connection.java index daef4ceeda..39afc76807 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/Connection.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/Connection.java @@ -548,9 +548,11 @@ class Connection { void disconnectComplete() { _connected = false; - if (_socket != null) - _socket.destroy(); - _socket = null; + I2PSocketFull s = _socket; + if (s != null) { + s.destroy2(); + _socket = null; + } if (_outputStream != null) _outputStream.destroy(); if (_receiver != null) diff --git a/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketFull.java b/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketFull.java index 7410028075..5a490ce849 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketFull.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketFull.java @@ -131,12 +131,21 @@ class I2PSocketFull implements I2PSocket { void destroy() { Connection c = _connection; - _connection = null; - _listener = null; + destroy2(); if (c != null) c.disconnectComplete(); } + /** + * Call from Connection.disconnectComplete() + * instead of destroy() so we don't loop + * @since 0.8.13 + */ + void destroy2() { + _connection = null; + _listener = null; + } + /** * The remote port. * @return the port or 0 if unknown diff --git a/history.txt b/history.txt index 67e5b6cfab..49b6717b51 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,6 @@ +2012-02-20 zzz + * Streaming: Fix race NPE (thx echelon) + 2012-02-17 zzz * i2psnark: Escape fixes * netdb.jsp: Fix debug median calculation diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index affa6f41b1..25340f779d 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 14; + public final static long BUILD = 15; /** for example "-test" */ public final static String EXTRA = "-rc";