DirWatch crashes
The DirWatch unit observes the song-dirs for changes on the song (and lyrics?) files. If USDX displays the Song-Screen USDX crashes if a song-file is changed. Probably because of a race-condition between the main and the DirWatch-thread. Both of them access the CatSongs array concurrently.
To fix this problem either CatSongs must be locked or the DirWatch thread just signals changes instead of accessing CatSongs directly. The later one is the preferred solution and can be achieved with SDL_PushEvent/SDL_WaitEvent that will issue a RefreshSongList() performed by the main thread.
To fix this problem either CatSongs must be locked or the DirWatch thread just signals changes instead of accessing CatSongs directly. The later one is the preferred solution and can be achieved with SDL_PushEvent/SDL_WaitEvent that will issue a RefreshSongList() performed by the main thread.
Leave a comment