# Stop immediate throws warnings on programmer sounds unity

**URL:** <https://qa.fmod.com/t/stop-immediate-throws-warnings-on-programmer-sounds-unity/16738>\
**Category:** Unity\
**Created:** [February 12, 2021, 2:04am UTC](https://qa.fmod.com/t/stop-immediate-throws-warnings-on-programmer-sounds-unity/16738 "2021-02-12T02:04:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![VoodooDetective](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@VoodooDetective](https://qa.fmod.com/u/VoodooDetective)\
**Post date:** [February 12, 2021, 2:04am UTC](https://qa.fmod.com/t/stop-immediate-throws-warnings-on-programmer-sounds-unity/16738/1 "2021-02-12T02:04:56Z")

</div>

EventInstance.stop(FMOD.Studio.STOP\_MODE.IMMEDIATE);  
EventInstance.release();

Throws this warning:  
[FMOD] EventInstance::flushReleaseQueue : Event instance has programmer sounds pending release, update thread will be bloocked until programmer sounds are released.

If I allow fade out, then I don’t get the warning. But if the sound is paused, then it never gets released.

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [February 12, 2021, 4:28am UTC](https://qa.fmod.com/t/stop-immediate-throws-warnings-on-programmer-sounds-unity/16738/2 "2021-02-12T04:28:47Z")

</div>

[`Studio::EventInstance::release`](https://www.fmod.com/resources/documentation-api?version=2.1&page=studio-api-eventinstance.html#studio_eventinstance_release) marks an event instance to be released as soon as it is stopped. We therefore generally recommend calling `Studio::EventInstance::release` as soon as you start the event instance, so that it can be cleaned up immediately as soon as it finishes playing. Since you are only calling `Studio::EventInstance::release` _after_ the event has stopped, FMOD is warning you that the event’s sounds cannot be released because the event has not been marked for release.

If you allow an event to fade-out when stopping it, it may take some time to stop. Since you are calling `Studio::EventInstance::release` immediately after calling for the event to stop, this means that the event is being marked for release before it finally stops, thus preventing the situation that causes the warning.

Pausing an event does not change the event’s playback state, so playing event that is paused still has the “playing” playback state, not the “stopped” playback state. This is intentional, to allow paused events to be un-paused and resume playing at a moment’s notice.

In other words, it sounds like you’re experiencing the expected behavior.

---

<div class="post-metadata">

**Author:** ![VoodooDetective](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@VoodooDetective](https://qa.fmod.com/u/VoodooDetective)\
**Post date:** [February 12, 2021, 7:11pm UTC](https://qa.fmod.com/t/stop-immediate-throws-warnings-on-programmer-sounds-unity/16738/3 "2021-02-12T19:11:32Z")

</div>

Thanks for the detailed information! I didn’t know that release had to be called before stop. That’s really good to know. It’d be awesome if you guys could add the requirement to release before stopping to the documentation. Maybe I missed it, but I don’t see it here:  
[https://fmod.com/resources/documentation-api?version=2.0&page=studio-api-eventinstance.html#studio\_eventinstance\_release](https://fmod.com/resources/documentation-api?version=2.0&page=studio-api-eventinstance.html#studio_eventinstance_release)

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [February 14, 2021, 11:57pm UTC](https://qa.fmod.com/t/stop-immediate-throws-warnings-on-programmer-sounds-unity/16738/4 "2021-02-14T23:57:00Z")

</div>

> [@VoodooDetective](#):
>
> I didn’t know that release had to be called before stop.

Release doesn’t _have_ to be called before stopping, the event, it’s just good practice, as it ensures that an event ceases taking up resources immediately upon stopping instead of continuing to take up resources until release is called.

> [@VoodooDetective](#):
>
> It’d be awesome if you guys could add the requirement to release before stopping to the documentation.

Good idea! I’ve a task to document this information to our feature/improvement tracker.
