fix audio not being disposed in correct order

main
cosmonaut 2022-04-20 14:59:02 -07:00
parent 527622142f
commit 37948ce79f
1 changed files with 5 additions and 5 deletions

View File

@ -241,16 +241,16 @@ namespace FineAudio
{
if (disposing)
{
for (var i = streamingSounds.Count - 1; i >= 0; i--)
for (var i = resources.Count - 1; i >= 0; i--)
{
var weakReference = streamingSounds[i];
var weakReference = resources[i];
if (weakReference.TryGetTarget(out var streamingSound))
if (weakReference.TryGetTarget(out var resource))
{
streamingSound.Dispose();
resource.Dispose();
}
}
streamingSounds.Clear();
resources.Clear();
}
FAudio.FAudioVoice_DestroyVoice(ReverbVoice);