-
Notifications
You must be signed in to change notification settings - Fork 52
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
node event listener warning #29
Comments
There's probably a memory leak somewhere in the library. I've gotten this warning as well. I never tested the case where objects come and go in a loop because that's not what I was doing with it. I would like to see this fixed. It would help if you could post the warnings you are getting and a minimal test case to show the bug. If you want to look into the library and see what's going on that would be helpful as well. |
thanks for the quick answer :) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 {"path":"/org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/player0","interface":"org.freedesktop.DBus.Properties","member":"PropertiesChanged"} listeners added. Use emitter.setMaxListeners() to increase limit i think that this warn is thrown because of the listeners added to get the "properties-changed" events inside _initXml inside proxy-object.js file , is that possible? |
hello , i've modified the proxy-object file and add a new method to it , give it a try when you can call this method when you don't need anymore a proxy object (it free the internal listeners). |
i've modified the function removeAllEventListeners , we can call this function when we are destroyng a proxy obj in order to release ALL the listeners for _signals , you are rigth, that's a better behaviour |
@leonardo-k can you look at bd08f64 and see if latest master fixes your issue without #30? |
I believe this is resolved by that commit. |
hi, that's a great library :)...but i have a problem using it :(
i'm wasn't able to find a method to remove the listeners from the internal interfaces of the library .
i'm working on an app that use bluez and bluetooth , and client can connect/disconnect very rapidly.
every time i connect a device a proxy obj is created and i read some property(mac address,name ecc ecc) , if the device is of a specific type, i put a call .on('PropertiesChanged') on the interface that i need to check.
after a few devices connection/disconnection , node tells a warn saying that i am adding too mutch event listeners for the same event ('PropertiesChanged event) but every time a device is removed i call removeListeners method on the all interfaces that listen to this event and i've got no errors ,also i destroy the interfaces with
iface=null
so ... there is a right way to remove obj and interfaces? what iam i doing wrong?
The text was updated successfully, but these errors were encountered: