Skip to content

Commit

Permalink
chore: release 3.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed May 13, 2020
1 parent d2daa28 commit f19a9e3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [3.4.2](https://github.com/socketio/engine.io-client/compare/3.4.1...3.4.2) (2020-05-13)



## [3.4.1](https://github.com/socketio/engine.io-client/compare/3.4.0...3.4.1) (2020-04-17)


Expand Down
14 changes: 13 additions & 1 deletion engine.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -3101,6 +3101,13 @@ return /******/ (function(modules) { // webpackBootstrap
break;
}
}

// Remove event specific arrays for event types that no
// one is subscribed for to avoid memory leak.
if (callbacks.length === 0) {
delete this._callbacks['$' + event];
}

return this;
};

Expand All @@ -3114,9 +3121,14 @@ return /******/ (function(modules) { // webpackBootstrap

Emitter.prototype.emit = function(event){
this._callbacks = this._callbacks || {};
var args = [].slice.call(arguments, 1)

var args = new Array(arguments.length - 1)
, callbacks = this._callbacks['$' + event];

for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}

if (callbacks) {
callbacks = callbacks.slice(0);
for (var i = 0, len = callbacks.length; i < len; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "engine.io-client",
"description": "Client for the realtime Engine",
"license": "MIT",
"version": "3.4.1",
"version": "3.4.2",
"main": "lib/index.js",
"homepage": "https://github.com/socketio/engine.io-client",
"contributors": [
Expand Down

0 comments on commit f19a9e3

Please sign in to comment.