Merge pull request #970 from vmarchesin/fix-memory-leak-issue-952

[FIX] Resolve #952 - memory leak in createEventHub
This commit is contained in:
Angelos Chalaris
2019-05-30 09:15:58 +03:00
committed by GitHub
3 changed files with 4 additions and 2 deletions

View File

@ -423,6 +423,7 @@
" off(event, handler) {",
" const i = (this.hub[event] || []).findIndex(h => h === handler);",
" if (i > -1) this.hub[event].splice(i, 1);",
" if (this.hub[event].length === 0) delete this.hub[event];",
" }",
"});"
],