Jump to content
  • Advertisement
Sign in to follow this  

DirectSound Releasing

This topic is 4829 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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!