Skip to content

Commit

Permalink
Auto-halt on close
Browse files Browse the repository at this point in the history
  • Loading branch information
tcstewar committed May 3, 2017
1 parent db493ad commit e34f502
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nengo_spinnaker/simulator.py
Expand Up @@ -391,6 +391,7 @@ def func(t, x, f=old_func):
def close(self):
"""Clean the SpiNNaker board and prevent further simulation."""
if not self._closed:
self.async_halt()
# Stop the application
self._closed = True
self.io_controller.close()
Expand Down Expand Up @@ -437,8 +438,9 @@ def async_update(self):
self.host_sim.step()

def async_halt(self):
self.controller.send_signal("stop")
self.io_thread = None
if self.io_thread is not None:
self.controller.send_signal("stop")
self.io_thread = None


@atexit.register
Expand Down

0 comments on commit e34f502

Please sign in to comment.