# Game sfx stop and prevents game from closing properly

**URL:** <https://qa.fmod.com/t/game-sfx-stop-and-prevents-game-from-closing-properly/22205>\
**Category:** FMOD Engine\
**Tags:** cpp\
**Created:** [October 22, 2024, 5:03am UTC](https://qa.fmod.com/t/game-sfx-stop-and-prevents-game-from-closing-properly/22205 "2024-10-22T05:03:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmcmorris](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jmcmorris/32/5406_2.png) [@jmcmorris](https://qa.fmod.com/u/jmcmorris)\
**Post date:** [October 22, 2024, 5:03am UTC](https://qa.fmod.com/t/game-sfx-stop-and-prevents-game-from-closing-properly/22205/1 "2024-10-22T05:03:29Z")

</div>

Hello, some players are running into an audio issue with my game and I was hoping I could get some help here. I’m using a custom c++ engine with FMOD 2.02.11 (I just now upgraded to 2.02.24).

The issue is that after a long play session the sfx audio will suddenly stop playing. Once this does happen the exe wont close properly either. This leads me to believe that the fmod system is getting into a broken state somehow.

When the game is exiting one thing it will do is cleanup fmod by doing the following.

```auto
for (auto bank : s_banks) {
    bank->unload();
}
// m_system is a FMOD::Studio::System*
s_system->flushCommands();
s_system->release();

```

I see in the documentation that flushCommands is blocking so I believe it is this call that prevents the game from properly closing.

How is it that the FMOD system can get into this state? Any tips on how to debug this would be greatly appreciated! If there is additional information needed then please let me know and I’ll do my best to provide it.

Thank you!

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [October 30, 2024, 11:29pm UTC](https://qa.fmod.com/t/game-sfx-stop-and-prevents-game-from-closing-properly/22205/2 "2024-10-30T23:29:22Z")

</div>

Apologies for the delayed response.

Can I get you to use [`Debug_Initialize`](https://www.fmod.com/docs/2.02/api/core-api-common.html#debug_initialize) with the logging libs (i.e. fmodL.dll), set the `flags` argument to [`FMOD_DEBUG_LEVEL_LOG`](https://www.fmod.com/docs/2.02/api/core-api-common.html#fmod_debug_flags), and post a log where the issue occurs? I would also recommend logging the results of your FMOD calls, since most of them will return a result which may help to indicate where the issue is occurring.
