Skip to content

Conversation

@azmodii
Copy link

@azmodii azmodii commented Apr 17, 2021

In my current application, the user can select a download location. This can be updated many times in a single session. Due to being unable to update the path once a handler is registered, I have resorted to calling DownloadManager.register to update the path. The existing code causes multiple handlers to be registered when calling DownloadManager.register multiple times.

This causes the following output from node:

(node:3256) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 browser-window-created listeners added to [App]. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:390:17)
    at App.addListener (events.js:406:10)
    ...

A more permanent solution would be an API to allow the update of the options parameter, but the module still should not cause this behaviour if used incorrectly. This PR fixes that behaviour.

In my current application, the user can select a download location. This can be updated many times in a single session. The existing code causes multiple handlers to be registered when calling DownloadManager.register.

This causes the following output from node:
```
(node:3256) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 browser-window-created listeners added to [App]. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:390:17)
    at App.addListener (events.js:406:10)
    ...
```

A more permanent solution would be an API to allow the update of the options parameter, but the module still should not cause this behaviour if used incorrectly.
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