SoundEffectInstance leaks #210
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In the current AudioManager, playing a sound is done by creating an instance before playing it:
https://github.com/SirCmpwn/TrueCraft/blob/master/TrueCraft.Client/AudioManager.cs#L117
The instance is not stored, however, so the native resources can get leaked and may result in lost sound after the resources have been fully expended.
The framework can manage these instances if SoundEffect.Play() is used...
https://msdn.microsoft.com/en-us/library/dd904205.aspx
... and that's basically the fix for the issue. The method becomes this:
The downside to this is that looping and 3D positioning aren't supported, but TrueCraft does not currently use either feature. If either are needed, instance management will be needed as well.
Thanks for the head's up. Will address that.