Not sure what the preconditions are to hit this; might need to mess with it a bit. Encountered this when switching from FluidSynth to OPL3, listening to OPL3 for a while, then switching back. Suspect there might be some race condition where I am closing the stream on the ZMusic end before the audio stream stops polling for more buffers.
Application: Helion.exe
CoreCLR Version: 8.0.824.36612
.NET Version: 8.0.8
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Stack:
at ZMusicWrapper.ZMusicPlayer.IsPlayingImpl()
at ZMusicWrapper.ZMusicPlayer.FillStreamFromFloatSource(Int16[])
at Helion.Client.Music.AudioStream.PollingLoop(System.Threading.CancellationToken)
at Helion.Client.Music.AudioStream+<>c__DisplayClass29_0.<Play>b__1()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
Not sure what the preconditions are to hit this; might need to mess with it a bit. Encountered this when switching from FluidSynth to OPL3, listening to OPL3 for a while, then switching back. Suspect there might be some race condition where I am closing the stream on the ZMusic end before the audio stream stops polling for more buffers.