# Bug report : FMOD sometimes keeps playing after playmode ended

**URL:** <https://qa.fmod.com/t/bug-report-fmod-sometimes-keeps-playing-after-playmode-ended/16825>\
**Category:** Unity\
**Created:** [March 1, 2021, 11:17pm UTC](https://qa.fmod.com/t/bug-report-fmod-sometimes-keeps-playing-after-playmode-ended/16825 "2021-03-01T23:17:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mudloop](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@Mudloop](https://qa.fmod.com/u/Mudloop)\
**Post date:** [March 1, 2021, 11:17pm UTC](https://qa.fmod.com/t/bug-report-fmod-sometimes-keeps-playing-after-playmode-ended/16825/1 "2021-03-01T23:17:56Z")

</div>

On my M1 Mac Mini, FMOD often keeps playing after I end playmode in the Unity editor.

I believe the bug mostly happens if I made some changes to scripts while in playmode. I have Unity set up to compile after I end playmode, and it seems like when this happens, the FMOD instance isn’t properly cleaned up.

Because of this I try to avoid saving changes to scripts while in playmode, but I often forget and it still happens several times a day, so I’m hoping this can be fixed.

Thanks!

---

<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:** [March 8, 2021, 11:42pm UTC](https://qa.fmod.com/t/bug-report-fmod-sometimes-keeps-playing-after-playmode-ended/16825/2 "2021-03-08T23:42:28Z")

</div>

It sounds like the FMOD system is not being cleaned up correctly when exiting play mode. I’ve not been able to replicate this issue on our machines, are you able to make a small Unity project where this happens and share it with us?

---

<div class="post-metadata">

**Author:** ![dafar](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@dafar](https://qa.fmod.com/u/dafar)\
**Post date:** [March 18, 2021, 2:47pm UTC](https://qa.fmod.com/t/bug-report-fmod-sometimes-keeps-playing-after-playmode-ended/16825/3 "2021-03-18T14:47:54Z")

</div>

It happened with me a few times during the last 3 days.

I’m using Macbook Pro 16" with Unity 2020.2.1f1.

I can’t replicate though.

---

<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:** [March 22, 2021, 3:28am UTC](https://qa.fmod.com/t/bug-report-fmod-sometimes-keeps-playing-after-playmode-ended/16825/4 "2021-03-22T03:28:16Z")

</div>

Are you able to share that Unity project with us to investigate further, please?

---

<div class="post-metadata">

**Author:** ![Mudloop](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@Mudloop](https://qa.fmod.com/u/Mudloop)\
**Post date:** [May 19, 2021, 7:28pm UTC](https://qa.fmod.com/t/bug-report-fmod-sometimes-keeps-playing-after-playmode-ended/16825/5 "2021-05-19T19:28:00Z")

</div>

I’m sorry, I didn’t see these responses. It’s a somewhat large game project with lot of proprietary code, and a bunch of plugins that I purchased, so I can’t just share the source.

---

<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:** [May 25, 2021, 1:00am UTC](https://qa.fmod.com/t/bug-report-fmod-sometimes-keeps-playing-after-playmode-ended/16825/6 "2021-05-25T01:00:26Z")

</div>

This makes it more difficult but you will need to check for things that could be keeping the FMOD system from being cleaned up. Do you use callbacks in your code? Try searching for `GCHandle.Alloc`, `GCHandle.ToIntPtr`, or `GCHandleType.Pinned`. Maybe there’s something pinned to memory that could be causing this to happen.
