Advertisement Jump to content
Sign in to follow this  

DirectSound Releasing

This topic is 4898 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I had a problem with my DirectSound performance, loader, and listener occasionally throwing errors when the game was shutting down because of bad/unreadable memory. I seem to have fixed it (or possibly just buried the bug deeper) by reordering the way in which they were released. Originally, I released them as: m_performance->Stop(NULL, NULL, 0, 0); m_performance->CloseDown(); SafeRelease(m_listener); SafeRelease(m_loader); SafeRelease(m_performance); and would get the error when the listener tried to release itself. Thinking that maybe "Stop" or "CloseDown" was doing something to the listener, I reorganized it to : SafeRelease(m_listener); SafeRelease(m_loader); m_performance->Stop(NULL, NULL, 0, 0); m_performance->CloseDown(); SafeRelease(m_performance); Which seems to work now after many tests. My question is if there is a specific order that DSound objects must be released in? If so, is it based off things like "Stop" and "CloseDown"? or is it based off the order in which they were created? If not, does anyone else see and care to explain what could have caused the error in the original order, but was fixed when reordering it? I looked for examples / explanations, but couldn't seem to find any the described what could be causing it. I did however, notice a few that never released their listener, so maybe it's not neccisarry? Thanks for any input. -Antrim

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!