Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[lib misc] modified destroy(), updated deps

  • Loading branch information...
commit de5013a1b693d37d815de2291de5816afe3a1b63 1 parent 7e59221
@jamesonjlee jamesonjlee authored
Showing with 7 additions and 7 deletions.
  1. +5 −5 lib/nssocket.js
  2. +2 −2 package.json
View
10 lib/nssocket.js
@@ -243,7 +243,9 @@ NsSocket.prototype.emitIdle = function emitIdle() {
// #### forcibly destroys this nsSocket, unregister socket, remove all callbacks
//
NsSocket.prototype.destroy = function destroy() {
- this.emit('destroy');
+ // this should be forcibly remove EVERY listener
+ this.removeAllListeners();
+
if (this.socket) {
try {
this.socket.end(); // send FIN
@@ -254,10 +256,8 @@ NsSocket.prototype.destroy = function destroy() {
}
}
// this may lead to memory leaks?
- // delete this.socket
-
- // this should be forcibly removing EVERY listener
- this.removeAllListeners();
+ delete this.socket;
+ this.emit('destroy');
};
//
View
4 package.json
@@ -12,10 +12,10 @@
"url": "http://github.com/nodejitsu/nssocket.git"
},
"dependencies": {
- "eventemitter2" : ">= v0.3.x"
+ "eventemitter2" : ">= v0.4.x"
},
"devDependencies": {
- "vows" : ">= 0.5.8"
+ "vows" : ">= 0.5.9"
},
"main": "./lib/nssocket",
"engines": {
Please sign in to comment.
Something went wrong with that request. Please try again.