Skip to content

Commit

Permalink
Release. Bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
bryaningl3 committed May 18, 2021
1 parent 2720860 commit 900d7c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@barchart/common-js",
"version": "4.9.0",
"version": "4.9.1",
"description": "Library of common JavaScript utilities",
"author": {
"name": "Bryan Ingle",
Expand Down
14 changes: 13 additions & 1 deletion test/SpecRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -27665,7 +27665,19 @@ module.exports = (() => {
let token;
const schedulePromise = promise.build((resolveCallback, rejectCallback) => {
const wrappedAction = () => {
delete this._timeoutBindings[token];
const disposable = this._timeoutBindings[token]; // 2021/05/18, BRI. Invoking dispose cases the clearTimeout function to run.
// Running clearTimeout should not be necessary because the timer has elapsed
// and the callback is being invoked. However, failing to call clearTimeout in
// a Node.js environment (after version 10) leads to a memory leak. Notice that
// this function has a reference to the Scheduler instance (via closure). In my
// view, this is breaking change between versions 10 and 12 of Node.js. I have
// been unable to locate any documentation regarding this change; however, a changes
// to did occur (which becomes obvious when inspecting the data structure returned by
// the setTimeout function).

if (disposable) {
disposable.dispose();
}

try {
resolveCallback(actionToSchedule());
Expand Down

0 comments on commit 900d7c5

Please sign in to comment.