Skip to content

Commit f4a4fcd

Browse files
author
RMPR
committed
Fix a crash if the play button is pressed during a replay
1 parent 501a416 commit f4a4fcd

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

atbswp/control.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -469,22 +469,22 @@ def action(self, event):
469469
toggle_button.Value = False
470470
return
471471
if count == 1 and not infinite:
472-
play_thread = Thread()
473-
play_thread.daemon = True
474-
play_thread = Thread(target=self.play,
472+
self.play_thread = Thread()
473+
self.play_thread.daemon = True
474+
self.play_thread = Thread(target=self.play,
475475
args=(capture, toggle_button,))
476-
play_thread.start()
476+
self.play_thread.start()
477477
else:
478478
i = 1
479479
while i <= count or infinite:
480-
play_thread = Thread()
481-
play_thread = Thread(target=self.play,
480+
self.play_thread = Thread()
481+
self.play_thread = Thread(target=self.play,
482482
args=(capture, toggle_button,))
483-
play_thread.start()
484-
play_thread.join()
483+
self.play_thread.start()
484+
self.play_thread.join()
485485
i += 1
486486
else:
487-
play_thread._stop() # Can be deprecated
487+
self.play_thread._stop() # Can be deprecated
488488
toggle_button.Value = False
489489

490490

0 commit comments

Comments
 (0)