# Instances not releasing properly when using AllowFadeout

**URL:** <https://qa.fmod.com/t/instances-not-releasing-properly-when-using-allowfadeout/17852>\
**Category:** FMOD Engine\
**Tags:** unity\
**Created:** [October 27, 2021, 10:46am UTC](https://qa.fmod.com/t/instances-not-releasing-properly-when-using-allowfadeout/17852 "2021-10-27T10:46:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexgreen3](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@Alexgreen3](https://qa.fmod.com/u/Alexgreen3)\
**Post date:** [October 27, 2021, 10:46am UTC](https://qa.fmod.com/t/instances-not-releasing-properly-when-using-allowfadeout/17852/1 "2021-10-27T10:46:07Z")

</div>

We’ve run into an issue where if our emitters have a ADHSR fadeout and our code calls Stop.AllowFadout then subsequently calls Release it fails and the instance and voice use remain. So we end up with voices/instances building up. At least this is what appears to be happening as when we use Stop.Immediate it works as expected.

FMOD.RESULT for the instance release always returns OK but our profiling/debug menu shows the instance count not reducing.

Any one run into this issue?

Unity version - 2020.3.14 FMOD version - 2.01.09

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [November 3, 2021, 12:29am UTC](https://qa.fmod.com/t/instances-not-releasing-properly-when-using-allowfadeout/17852/2 "2021-11-03T00:29:03Z")

</div>

I’ve not been able to replicate this issue. I’ve got Unity to play and release events with and without AHDSR using stop with allowing fadeout and immediately.

Are you able to post the code that you use to stop and release these events?

---

<div class="post-metadata">

**Author:** ![Alexgreen3](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@Alexgreen3](https://qa.fmod.com/u/Alexgreen3)\
**Post date:** [November 4, 2021, 3:47pm UTC](https://qa.fmod.com/t/instances-not-releasing-properly-when-using-allowfadeout/17852/3 "2021-11-04T15:47:30Z")

</div>

We’ve got to the bottom of it. We have a SoundRoom system whereby if you’re outside of an specified area but within a sounds sphere collider of a sound tied to that area, the code fades the sound down and pauses it.

When the instance is paused it doesn’t seem to ever release, so to the solution was to manually unpause it when releasing!

Not sure whether this is the intended functionality or a bug.

Thanks for looking into it!

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [November 4, 2021, 10:08pm UTC](https://qa.fmod.com/t/instances-not-releasing-properly-when-using-allowfadeout/17852/4 "2021-11-04T22:08:06Z")

</div>

This is by design. An event can only be released when it has come to a complete stop. This prevents events from accidentally being released if a pause menu is brought up or something similar.
