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();
|
this.socket.pause();
|
||||||
yield this.handlePacket(packet);
|
yield this.handlePacket(packet);
|
||||||
} finally {
|
} finally {
|
||||||
this.socket.resume();
|
if (!this.destroyed)
|
||||||
|
this.socket.resume();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -1513,7 +1514,8 @@ Peer.prototype.readPacket = co(function* readPacket(packet) {
|
|||||||
this.socket.pause();
|
this.socket.pause();
|
||||||
yield this.handlePacket(packet);
|
yield this.handlePacket(packet);
|
||||||
} finally {
|
} finally {
|
||||||
this.socket.resume();
|
if (!this.destroyed)
|
||||||
|
this.socket.resume();
|
||||||
unlock();
|
unlock();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user