Skip to content

Commit

Permalink
[fix] Fix use after invalidation bug
Browse files Browse the repository at this point in the history
Fixes #1418
  • Loading branch information
lpinca committed Jul 11, 2018
1 parent 175ce46 commit 8aba871
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,6 @@ function socketOnClose () {

this.removeListener('close', socketOnClose);
this.removeListener('end', socketOnEnd);
this[kWebSocket] = undefined;

websocket.readyState = WebSocket.CLOSING;

Expand All @@ -771,6 +770,8 @@ function socketOnClose () {
websocket._receiver.end();

this.removeListener('data', socketOnData);
this[kWebSocket] = undefined;

clearTimeout(websocket._closeTimer);

if (
Expand Down

0 comments on commit 8aba871

Please sign in to comment.