Skip to content

Commit

Permalink
Set watcher.next to null after it's removed from dumpQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Nov 30, 2010
1 parent 11f7ff0 commit de906c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/node_io_watcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ void IOWatcher::Dump(EV_P_ ev_prepare *watcher, int revents) {

// Drop the watcher_obj from the list.
watcher_obj_last->Set(next_sym, watcher_obj->Get(next_sym));
watcher_obj->Set(next_sym, Null());

// Emit drain event
if (watcher_obj->Has(ondrain_sym)) {
Expand Down
2 changes: 2 additions & 0 deletions test/simple/test-dumper.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ function test (N, b, cb) {
x = x.next;
}

assert.equal(null, w.next);

ncomplete++;
if (cb) cb();
});
Expand Down

0 comments on commit de906c4

Please sign in to comment.