def on_exit(self, event):
# For some reason, the timer still tries to play the song even after the windows is being closed.
# (probably because window destruction is not synchronous, a wx.Yield() would probably fix it)
# The timer function even checks to see if the player is still loaded, but apparently the player is not
# destroyed when the window is destroyed, resulting in the player trying to play a song
# and Python crashes with exit code -1073741819 (0xC0000005) [Windows]
self.timer.Stop()
self.player.Load('') # Unload whatever is in the MediaCtrl. (prevent file lockup)
event.Skip()
评论列表
文章目录