Skip to content

Commit

Permalink
Fix a crash if the play button is pressed during a replay
Browse files Browse the repository at this point in the history
  • Loading branch information
RMPR committed Apr 19, 2020
1 parent 501a416 commit f4a4fcd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions atbswp/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,22 +469,22 @@ def action(self, event):
toggle_button.Value = False
return
if count == 1 and not infinite:
play_thread = Thread()
play_thread.daemon = True
play_thread = Thread(target=self.play,
self.play_thread = Thread()
self.play_thread.daemon = True
self.play_thread = Thread(target=self.play,
args=(capture, toggle_button,))
play_thread.start()
self.play_thread.start()
else:
i = 1
while i <= count or infinite:
play_thread = Thread()
play_thread = Thread(target=self.play,
self.play_thread = Thread()
self.play_thread = Thread(target=self.play,
args=(capture, toggle_button,))
play_thread.start()
play_thread.join()
self.play_thread.start()
self.play_thread.join()
i += 1
else:
play_thread._stop() # Can be deprecated
self.play_thread._stop() # Can be deprecated
toggle_button.Value = False


Expand Down

0 comments on commit f4a4fcd

Please sign in to comment.