# Freeze on Game Exit

**URL:** <https://qa.fmod.com/t/freeze-on-game-exit/23866>\
**Category:** Unreal Engine\
**Created:** [January 8, 2026, 2:27pm UTC](https://qa.fmod.com/t/freeze-on-game-exit/23866 "2026-01-08T14:27:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![apfelbaum](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/apfelbaum/32/4843_2.png) [@apfelbaum](https://qa.fmod.com/u/apfelbaum)\
**Post date:** [January 8, 2026, 2:27pm UTC](https://qa.fmod.com/t/freeze-on-game-exit/23866/1 "2026-01-08T14:27:42Z")

</div>

Hi, I am using the current latest FMOD Plugin for UE5.7 and whenever I exit the game in PIE the game freezes indefinitely. Here is the last log entry, I always have to close the engine via task manager. I have the assumption that I have to release certain sounds as I am not always using the `UFMODAudioComponent `ut often do programmer sound handling via the callbacks the fmod api offers. In what situation do I have to release sounds manually? How can I debug such a situtation?

> [2026.01.08-14.20.53:211][969]LogFMOD: Warning: C:\buildagent1\work\c1c3f17eb167c494\studio\_api\src\fmod\_playback\_event.cpp(2939) - Event instance has programmer sounds pending release, update thread will be blocked until programmer sounds are released.

Best regards.

P.S. This only happens using using “ESC” to escape PIE, using the regular “quit game” function has no trouble.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [January 15, 2026, 4:47am UTC](https://qa.fmod.com/t/freeze-on-game-exit/23866/2 "2026-01-15T04:47:59Z")

</div>

The `FMODAudioComponent` handles all the creation and cleanup when using programmer sounds through it, so if you aren’t using it then any sounds you create you will be responsible for, eg. creating sounds inside callbacks for programmer instruments.

Generally this is done from the [FMOD\_STUDIO\_EVENT\_CALLBACK\_DESTROY\_PROGRAMMER\_SOUND](https://www.fmod.com/docs/2.03/api/studio-api-eventinstance.html#fmod_studio_event_callback_type) callback, although the event may need to be stopped first to trigger this callback.

---

<div class="post-metadata">

**Author:** ![apfelbaum](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/apfelbaum/32/4843_2.png) [@apfelbaum](https://qa.fmod.com/u/apfelbaum)\
**Post date:** [April 28, 2026, 11:43am UTC](https://qa.fmod.com/t/freeze-on-game-exit/23866/4 "2026-04-28T11:43:28Z")

</div>

@cameron-fmod  
Ok, sorry for my bazillion edits and deletion. I can now say for sure what the problem is:

I have a custom DSP, and I have to put the Unreal Engine `EventInstance` that FMOD creates into this DSP as a pointer, because the DSP sets a parameter (it calculates) inside the `EventInstance`.

When Unreal Engine eg. crashes or ends PIE, then before Unreal Engine is able to call `EndPlay` on my actor the `EventInstance` is already destroyed but it seems like DSP still runs (perhaps in the FMOD mixer thread) and thus accesses the invalid `EventInstance` pointer. Apparently there is also no callback by FMOD that early enough gets called so I can set this pointer to a `nullptr`.

If I had at least native access to the `EventInstance` inside the FMOD plugin without doing all this pointer spaghetti that wouldn’t be a problem, so what can I do about this?

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [May 7, 2026, 4:58am UTC](https://qa.fmod.com/t/freeze-on-game-exit/23866/5 "2026-05-07T04:58:16Z")

</div>

A while back we were having the same issue with `EndPlay` in our `FMODAudioComponents`, and our solution was to create a “shutdown” function that we could register to be called at the end of Play-In-Editor:

```auto
void UFMODAudioComponent::BeginPlay()
{
#if WITH_EDITOR
    IFMODStudioModule::Get().PreEndPIEEvent().AddUObject(this, &UFMODAudioComponent::Shutdown);
#endif
    ...
}

```

The problem was that when PIE ends, we need to clean things up and `EndPlay` was triggering too late.

---

<div class="post-metadata">

**Author:** ![apfelbaum](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/apfelbaum/32/4843_2.png) [@apfelbaum](https://qa.fmod.com/u/apfelbaum)\
**Post date:** [May 7, 2026, 6:33am UTC](https://qa.fmod.com/t/freeze-on-game-exit/23866/6 "2026-05-07T06:33:59Z")

</div>

Thanks for the answer, in case of EndPlay of PIE this solution works as well:

```auto
#if WITH_EDITOR
#include "Editor.h"
#endif

#if WITH_EDITOR
FEditorDelegates::EndPIE.AddUObject(this, &UMyGameInstance::OnEndPIE);
#endif

```

But that doesn’t handle the case of a crash in any environment (Editor, Shipping,…) for me. Do you have a solution for that case?

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [May 18, 2026, 9:52am UTC](https://qa.fmod.com/t/freeze-on-game-exit/23866/7 "2026-05-18T09:52:46Z")

</div>

You may be able to hook into [FCoreDelegates::OnHandleSystemError](https://dev.epicgames.com/documentation/unreal-engine/API/Runtime/Core/FCoreDelegates) but by the time the app has crashed it is possible that the heap may be corrupt.

If [Studio::System::release](https://fmod.com/docs/2.03/api/studio-api-system.html#studio_system_release) is called then that will free the memory used by the Studio System object and everything created under it.
