1
1
#
2
2
3
- program_name = 'EasyABC 1.3.7.9 2020-12-31'
3
+ == == == =
4
+ program_name = 'EasyABC 1.3.7.9 2021-01-01'
4
5
5
6
# Copyright (C) 2011-2014 Nils Liberg (mail: kotorinl at yahoo.co.uk)
6
7
# 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):
4296
4297
if midi_in_device_ID is not None :
4297
4298
metre_1 , metre_2 = list (map (int , self .settings ['record_metre' ].split ('/' )))
4298
4299
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
4299
4301
self .record_thread .start ()
4300
4302
4301
4303
def OnToolStop (self , evt ):
@@ -4444,6 +4446,9 @@ def flip_tempobox(self, state):
4444
4446
self .follow_score_check .Show (state )
4445
4447
self .UpdateTimingSliderVisibility ()
4446
4448
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
+
4447
4452
4448
4453
def show_toolbar_panel (self , panel , visible ):
4449
4454
#for sizer_item in panel.Sizer.Children:
@@ -6862,12 +6867,22 @@ def OnClose(self, evt):
6862
6867
return
6863
6868
6864
6869
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?'''
6866
6874
if wx .TheClipboard .Open ():
6867
6875
wx .TheClipboard .Flush () # the text on the clipboard should be available after the app has closed
6868
6876
wx .TheClipboard .Close ()
6869
6877
6870
6878
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
+
6871
6886
self .svg_tunes .cleanup ()
6872
6887
self .midi_tunes .cleanup ()
6873
6888
self .settings ['is_maximized' ] = self .IsMaximized ()
@@ -6877,6 +6892,17 @@ def OnClose(self, evt):
6877
6892
self .save_settings ()
6878
6893
self .is_closed = True
6879
6894
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()
6880
6906
self .Destroy ()
6881
6907
6882
6908
# 1.3.6.3 [JWDJ] DetermineMidiPlayRange is not used anymore
0 commit comments