Closed cmaglie closed 4 years ago
Here is my windows fix for this. Feel free to cherry pick:
https://github.com/Lobaro/go-serial/commit/9f75a18e7cf739a6d65d1405f13bea1307307e50 https://github.com/Lobaro/go-serial/commit/06091fa1ae6a1330e3b43854667e0f4137bd347e
If the user do a double
Close()
on the same port object the underlyinghandle
is actually closed twice. This may not be a problem when working with onePort
object at a time, but it may result in problematic behavior in multi-threaded environments (in particular on unix where handles are reused this may result in the first object 'leaking' the handle).Ideally the
Close()
method should return thePortClosed
error if called twice.