Merge pull request #38 from kylelemons/context_race

Remove context close race condition
This commit is contained in:
zagrodzki
2017-02-24 17:32:22 +01:00
committed by GitHub

View File

@@ -133,7 +133,7 @@ func (c *Context) OpenDeviceWithVidPid(vid, pid int) (*Device, error) {
}
func (c *Context) Close() error {
close(c.done)
c.done <- struct{}{}
if c.ctx != nil {
C.libusb_exit(c.ctx)
}