3dbfa4919a
This fixes a crash that could occur during freeing of sources, as the audio subsystem was destroyed before sources were released. If a source had monitoring enabled, it would try to lock a mutex that has been destroyed, resulting in a crash. Freeing audio after obs_free_data was also not a solution, as the main view is freed in obs_free_data, and the audio subsystem is still running and trying to lock the main view channel mutex which has been freed. This seems to be the best middle ground, making sure the audio subsystem is stopped so it no longer tries to access the main view channel, then freed after obs_free_data. Fixes https://github.com/obsproject/obs-studio/issues/4409