peer: fix potential memory leak.
This commit is contained in:
parent
b7f0a1fb79
commit
695509b1b3
@ -1504,7 +1504,8 @@ Peer.prototype.readPacket = co(function* readPacket(packet) {
|
||||
this.socket.pause();
|
||||
yield this.handlePacket(packet);
|
||||
} finally {
|
||||
this.socket.resume();
|
||||
if (!this.destroyed)
|
||||
this.socket.resume();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -1513,7 +1514,8 @@ Peer.prototype.readPacket = co(function* readPacket(packet) {
|
||||
this.socket.pause();
|
||||
yield this.handlePacket(packet);
|
||||
} finally {
|
||||
this.socket.resume();
|
||||
if (!this.destroyed)
|
||||
this.socket.resume();
|
||||
unlock();
|
||||
}
|
||||
break;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user