OGRECave / ogre-audiovideo

plugins for theora video playback and openAL audio
https://ogrecave.github.io/ogre-audiovideo/
BSD 3-Clause "New" or "Revised" License
14 stars 11 forks source link

Release all sound sources when finalizing the Plugin #24

Closed sercero closed 3 years ago

sercero commented 3 years ago

Fix the following warning from OpenAL Soft: "[ALSOFT] (WW) 1 Source not deleted" (the more sounds one uses the more sources not deleted).

So, the problem was that mSourcePool was being used in OgreOggSoundManager::_releaseAll() to query which sources to destroy.

That is wrong because the pool gets depeleted each time that a sound source is requested by the Manager.

The fix was to add a new variable that registers the total amount of sources created initially.

Also in this commit are some changes to the formatting to have more consistency, I know it should have gone to another commit but I got carried away.