I found and fixed an issue with WinMM midi devices not disposing / closing correctly due to lock contention of the "lockObject". This would delay closes by 10 seconds and possibly not clean up buffers correctly.
Thanks for the patch. It was code contributed by @noname22 so let me wait for any possible comments for a day-ish. If no problem is found then I will merge it.
I found and fixed an issue with WinMM midi devices not disposing / closing correctly due to lock contention of the "lockObject". This would delay closes by 10 seconds and possibly not clean up buffers correctly.