Skip to content

Don't re-add "bytes" and "time" listeners on rebundle#167

Merged
1 commit merged intomasterfrom
fix-leaky-listeners-in-cmd
Mar 25, 2015
Merged

Don't re-add "bytes" and "time" listeners on rebundle#167
1 commit merged intomasterfrom
fix-leaky-listeners-in-cmd

Conversation

@zertosh
Copy link
Copy Markdown
Member

@zertosh zertosh commented Mar 25, 2015

The bytes and time listeners are getting re-added on every re-bundle. #155 proposes to fix this by adding the listeners with once instead of on. This works for cases when the build was successful, but if there was a build error, those handlers will never fire, thus never get unbound. To account for that would require that we hold references to listener functions and call removeListener with them if an error occurs - but that's too much.

It's easier to just bind the events one time when the browserify instance is created. This might lead to inconsistent log output if there is a race between concurrent rebuilds - but that's highly unlikely.

cc: @substack

@zertosh zertosh mentioned this pull request Mar 25, 2015
7 tasks
@ghost ghost merged commit 525a363 into master Mar 25, 2015
@zertosh zertosh deleted the fix-leaky-listeners-in-cmd branch March 25, 2015 21:52
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant