Skip to content

Commit

Permalink
Fixed NIDAQ crash on reload
Browse files Browse the repository at this point in the history
jazlinumn committed Sep 12, 2024
1 parent 264de58 commit f2e20f5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pybehave/Sources/NIDAQSource.py
Original file line number Diff line number Diff line change
@@ -91,6 +91,7 @@ def close_source(self):
self.do_task.close()
self.do_task = None
self.do_stream = None
self.do_inds = {}
for task in self.tasks:
task.close()
self.tasks = {}
@@ -102,15 +103,18 @@ def close_component(self, component_id):
self.ao_task.close()
self.ao_task = None
self.ao_stream = None
del self.ao_inds[component_id]
else:
if self.components[component_id].sr is not None:
if self.do_task is not None:
self.do_task.stop()
self.do_task.close()
self.do_task = None
self.do_stream = None
self.tasks[component_id].stop()
self.tasks[component_id].close()
del self.do_inds[component_id]
else:
self.tasks[component_id].stop()
self.tasks[component_id].close()

def write_component(self, component_id, msg):
if self.components[component_id].get_type() == Component.Type.DIGITAL_OUTPUT:

0 comments on commit f2e20f5

Please sign in to comment.