Skip to content

Commit

Permalink
timer: call list.start regardless new or not
Browse files Browse the repository at this point in the history
Call start regardless whether list is new
or not to prevent incorrect active_handles
count.

Fixes nodejs#25831.
  • Loading branch information
abbr committed Aug 30, 2015
1 parent 2860c53 commit eeeff57
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/timers.js
Expand Up @@ -59,14 +59,17 @@ function insert(item, msecs) {
list = lists[msecs];
} else {
list = new Timer();
list.start(msecs, 0);

L.init(list);

lists[msecs] = list;
list.msecs = msecs;
list[kOnTimeout] = listOnTimeout;
}
// Call start regardless whether list is new
// or not to prevent incorrect active_handles
// count. See issue #25831.
list.start(msecs, 0);

L.append(list, item);
assert(!L.isEmpty(list)); // list is not empty
Expand Down

0 comments on commit eeeff57

Please sign in to comment.