dmauro / Keypress

A keyboard input capturing utility in which any key can be a modifier key.
http://dmauro.github.io/Keypress/
Apache License 2.0
3.18k stars 313 forks source link

Memory leaks - can't unregister combo #34

Closed g00fy- closed 10 years ago

g00fy- commented 10 years ago

if register_combo https://github.com/dmauro/Keypress/blob/development/keypress.js#L645 creates new cobo object and pushes that object to the registered combo list, than obviously unregister_combo ( which checking combo equality by reference https://github.com/dmauro/Keypress/blob/development/keypress.js#L672) won't work.

dmauro commented 10 years ago

Thanks for catching this. This is a big bug I introduced in 2.0. Will get a fix out as soon as I have a few minutes to spend with Keypress.

dmauro commented 10 years ago

The fix is in the develop branch (and the docs have been updated in the gh-pages-dev branch) and I should be pushing that through to master tomorrow. The way you should be doing this is passing the object you get from the register_combo or the array from register_many method calls back into the unregister_combo and unregister_many methods (in previous versions you would pass in the same dictionary or array you passed in to the register methods).

huzgo1 commented 10 years ago

Hi, I've clone today with bower and I'm still have problems on unregister_combo when the parameter keys_or_combo is a string.

Regards