Deivce closing if error

This commit is contained in:
2016-07-23 16:50:27 +05:00
parent 8ec5b2ebfc
commit 157d60fc6d

View File

@@ -91,11 +91,13 @@ func NewNooliteAdapter(mode, bitrate, repeats uint) (*NooliteAdapter, error) {
d.Configuration(1) d.Configuration(1)
if d.LastError() != "No error" { if d.LastError() != "No error" {
d.Close()
return nil, errors.New(d.LastError()) return nil, errors.New(d.LastError())
} }
d.Interface(0) d.Interface(0)
if d.LastError() != "No error" { if d.LastError() != "No error" {
d.Close()
return nil, errors.New(d.LastError()) return nil, errors.New(d.LastError())
} }