Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaxListenersExceededWarning in walletadapter #75

Open
stultusmundi opened this issue Feb 26, 2022 · 1 comment
Open

MaxListenersExceededWarning in walletadapter #75

stultusmundi opened this issue Feb 26, 2022 · 1 comment

Comments

@stultusmundi
Copy link

Hi the following code was not properly clearing EventEmitter events causing MaxListenersExceededWarning.
wallet.ts line 150
public destroy() {
networkEvents.off('network_change', this.onNetworkChange);
}

I was able to resolve the waring using
networkEvents.removeAllListeners('network_change');
or
networkEvents.removeAllListeners();

I am not familiar with EventEmitter so I just wanted to mainly report the issue.

@akdavidsson
Copy link

I am having a similar issue running the SDK on react-native [MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 101 network_change listeners added. Use emitter.setMaxListeners() to increase limit]. Keeps adding network_change listeners.

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

No branches or pull requests

2 participants