guymcswain / pigpio-client

A nodejs client for pigpio socket interface.
MIT License
28 stars 11 forks source link

Correct way to destroy the instance? #37

Closed btsimonh closed 1 year ago

btsimonh commented 1 year ago

Hi,

what is the correct way to completely destroy an instance?

At the moment, I'm calling end(), and then de-referencing the object - but not using a callback because I anticipate that the callback would not be called if the socket(s) had not connected (due to error or just not yet...)? I'm also calling endNotify() on the two GPIs that were being monitored (probably after end...). Is there anything else I need to do?

br, Simon

guymcswain commented 1 year ago

At the moment, I'm calling end(), and then de-referencing the object

That’s how I use the lib. I would do endNotify before end.