Skip to content

redo event delegation in promise wrappers to be lazy, self-cleaning - #620

Merged
sidorares merged 1 commit into
sidorares:masterfrom
rhendric:fix/sidorares/node-mysql2#577
Jul 31, 2017
Merged

sidorares merged 1 commit into
sidorares:masterfrom
rhendric:fix/sidorares/node-mysql2#577

Conversation

@rhendric

Copy link
Copy Markdown
Contributor

fix #577


I saw that #577 already had a fix in #578, but you seemed to have some concerns about that solution that I think I share, and I'm eager to see a fix for this issue actually land. So here's what I think the fix should be: it's fully lazy, so no event listeners get added to the wrapped object until one is added to the wrapper, and it removes those listeners as early as possible.

@sidorares

Copy link
Copy Markdown
Owner

Thanks, looking good, this is close to what I wanted to do (important part is that no listeners added at all by default - most users don't add any listeners on pool directly )

I'll have a closer look later tonight and try to merge!

@sidorares
sidorares merged commit cebd9bd into sidorares:master Jul 31, 2017
@a0000778 a0000778 mentioned this pull request Aug 5, 2017
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.

MaxListenersExceededWarning: Possible EventEmitter memory leak detected

2 participants