-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
EventEmitter memory leak? #33
Comments
This might have happened because I am not making use of |
Hi, thanks for the report! Yes indeed, I forgot to update the readme, will do. Could you confirm it fixes your issues though? |
Seems to have fixed it, thanks @apercu |
I believe, this problem is not completely fixed. Here is why: Since every new instance of the I escape this problem by manually call import { DeviceEventEmitter } from "react-native";
import Zeroconf from "react-native-zeroconf";
/* important part */
DeviceEventEmitter.removeAllListeners("RNZeroconfStart");
DeviceEventEmitter.removeAllListeners("RNZeroconfStop");
DeviceEventEmitter.removeAllListeners("RNZeroconfError");
DeviceEventEmitter.removeAllListeners("RNZeroconfFound");
DeviceEventEmitter.removeAllListeners("RNZeroconfRemove");
DeviceEventEmitter.removeAllListeners("RNZeroconfResolved");
DeviceEventEmitter.removeAllListeners("RNZeroconfServiceRegistered");
DeviceEventEmitter.removeAllListeners("RNZeroconfServiceUnregistered");
/* */
const zeroconf = new Zeroconf(); My suggestion is to do this in the |
I mounted and unmounted the component that scans for devices a few dozen times and received this message.
The text was updated successfully, but these errors were encountered: