avoid race condition on StreamingSound.Dispose

cosmonaut 2023-12-13 13:58:55 -08:00
parent 97dd112e7a
commit 52e7384e45
1 changed files with 8 additions and 5 deletions

View File

@ -149,6 +149,8 @@ namespace MoonWorks.Audio
protected override unsafe void Dispose(bool disposing)
{
if (!IsDisposed)
{
lock (StateLock)
{
Stop();
@ -160,6 +162,7 @@ namespace MoonWorks.Audio
}
}
}
}
base.Dispose(disposing);
}
}