yuriizubkov / petwant-device

Abstraction layer of an UART-based communication protocol for more convenient data exchange with the controller chip of the Petwant PF-103 pet feeder.
GNU General Public License v3.0
15 stars 0 forks source link

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 scheduleentry listeners added #2

Closed yuriizubkov closed 4 years ago

yuriizubkov commented 4 years ago

Bug. We are not removing proper event listener here: https://github.com/yuriizubkov/petwant-device/blob/a18c4e4ea3ab59d5059e4542714a50800b3b4092/index.js#L296 Because bind() creates a new instance of function, that is not equal to our declared function above: https://github.com/yuriizubkov/petwant-device/blob/a18c4e4ea3ab59d5059e4542714a50800b3b4092/index.js#L301 Completely forgot about this.

yuriizubkov commented 4 years ago

Fixed in v1.0.5