Skip to content

Commit 2ec9a60

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents db6ccbf + c1f270e commit 2ec9a60

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

easy_abc.py

+28-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#
22

3-
program_name = 'EasyABC 1.3.7.9 2020-12-31'
3+
=======
4+
program_name = 'EasyABC 1.3.7.9 2021-01-01'
45

56
# Copyright (C) 2011-2014 Nils Liberg (mail: kotorinl at yahoo.co.uk)
67
# Copyright (C) 2015-2020 Seymour Shlien (mail: [email protected]), Jan Wybren de Jong (jw_de_jong at yahoo dot com)
@@ -4296,6 +4297,7 @@ def OnToolRecord(self, evt):
42964297
if midi_in_device_ID is not None:
42974298
metre_1, metre_2 = list(map(int, self.settings['record_metre'].split('/')))
42984299
self.record_thread = RecordThread(self, midi_in_device_ID, midi_out_device_ID, metre_1, metre_2, bpm = self.settings['record_bpm'])
4300+
self.record_thread.daemon = True
42994301
self.record_thread.start()
43004302

43014303
def OnToolStop(self, evt):
@@ -4444,6 +4446,9 @@ def flip_tempobox(self, state):
44444446
self.follow_score_check.Show(state)
44454447
self.UpdateTimingSliderVisibility()
44464448
self.toolbar.Realize()
4449+
if wx.Platform == "__WXMAC__": #FAU: 23.12.2020: Added as issue in toolbar display when play and stop button are used
4450+
self.manager.Update()
4451+
44474452

44484453
def show_toolbar_panel(self, panel, visible):
44494454
#for sizer_item in panel.Sizer.Children:
@@ -6862,12 +6867,22 @@ def OnClose(self, evt):
68626867
return
68636868

68646869
wx.GetApp().UnRegisterFrame(self)
6865-
6870+
'''FAU 20201229: Need to stop the timer otherwise they could call back a routine that was destroyed and cause a segmentation fault on Mac'''
6871+
self.play_timer.Stop()
6872+
self.timer.Stop()
6873+
'''FAU 20201228: TODO: is it really what we want to do when multiple window?'''
68666874
if wx.TheClipboard.Open():
68676875
wx.TheClipboard.Flush() # the text on the clipboard should be available after the app has closed
68686876
wx.TheClipboard.Close()
68696877

68706878
self.music_update_thread.abort()
6879+
if self.play_music_thread != None:
6880+
self.play_music_thread.abort()
6881+
self.play_music_thread = None
6882+
if self.record_thread != None:
6883+
self.record_thread.abort()
6884+
self.record_thread = None
6885+
68716886
self.svg_tunes.cleanup()
68726887
self.midi_tunes.cleanup()
68736888
self.settings['is_maximized'] = self.IsMaximized()
@@ -6877,6 +6892,17 @@ def OnClose(self, evt):
68776892
self.save_settings()
68786893
self.is_closed = True
68796894
self.manager.UnInit()
6895+
#if wx.Platform != "__WXMAC__":
6896+
# '''FAU 20201228: Destroying will either freeze or crash Python with a seg fault on Mac.
6897+
# Seems like there are still events or resources not closed that ask to access after.
6898+
# Using wx.CallAfter(100, self.Destroy) leads to an assertion saying not a callable object)
6899+
# self.DestroyLater() does not fix either
6900+
# So for now just not destroy on Mac'''
6901+
# '''FAU 20201229: Seems that it was due to the timer that were not closed.
6902+
# self.Destroy()
6903+
#else:
6904+
#wx.CallAfter(100, self.Destroy)
6905+
#self.DestroyLater()
68806906
self.Destroy()
68816907

68826908
# 1.3.6.3 [JWDJ] DetermineMidiPlayRange is not used anymore

0 commit comments

Comments
 (0)