Skip to content

Commit

Permalink
lda_controller: fix memory leak
Browse files Browse the repository at this point in the history
sbourdeauducq committed Nov 29, 2014
1 parent 26180e7 commit 9c41f98
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions artiq/devices/lda/lda_controller.py
Original file line number Diff line number Diff line change
@@ -138,12 +138,13 @@ def __init__(self, serial=None, product="LDA-102"):
def enumerate(cls, product):
devs = hidapi.hid_enumerate(cls._vendor_id,
cls._product_ids[product])
dev = devs
while dev:
yield dev[0].serial
dev = dev[0].next
yield None
hidapi.hid_free_enumeration(devs)
try:
dev = devs
while dev:
yield dev[0].serial
dev = dev[0].next
finally:
hidapi.hid_free_enumeration(devs)

def _check_error(self, ret):
if ret < 0:

0 comments on commit 9c41f98

Please sign in to comment.