forked from I2P_Developers/i2p.i2p
Streaming: Fix race NPE (thx echelon)
This commit is contained in:
@ -548,9 +548,11 @@ class Connection {
|
||||
|
||||
void disconnectComplete() {
|
||||
_connected = false;
|
||||
if (_socket != null)
|
||||
_socket.destroy();
|
||||
I2PSocketFull s = _socket;
|
||||
if (s != null) {
|
||||
s.destroy2();
|
||||
_socket = null;
|
||||
}
|
||||
if (_outputStream != null)
|
||||
_outputStream.destroy();
|
||||
if (_receiver != null)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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";
|
||||
|
Reference in New Issue
Block a user