# Releasing events event

**URL:** <https://qa.fmod.com/t/releasing-events-event/11572>\
**Category:** FMOD Studio\
**Created:** [July 24, 2014, 6:14am UTC](https://qa.fmod.com/t/releasing-events-event/11572 "2014-07-24T06:14:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![buzzrick](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/buzzrick/32/473_2.png) [@buzzrick](https://qa.fmod.com/u/buzzrick)\
**Post date:** [July 24, 2014, 6:14am UTC](https://qa.fmod.com/t/releasing-events-event/11572/1 "2014-07-24T06:14:13Z")

</div>

Hi.  
I’m trying to implement an audio system based on the FMOD Studio API examples, and i’m having issues with releasing any of my EventInstances.

I have everything working, and my sounds are playing fine, (including a looping music event), however if i start and immediately release an EventInstance, then I get an access exception. I’m effectively doing this (with additional result error checking of course)

```
    instance->start();
    instance->release();

```

If i don’t release the instance, then everything runs fine, however I assume that it’ll eventually run out of memory over time.

I’m checking and confirming that indeed the EventDescription is a OneShot event.

The same occurs if I stop and release a looping audio event, or ANY of my events for that matter.

I am working on iOS, and i get an “EXC\_BAD\_ACCESS” exception. It appears to be in the FMOD::AsyncManager::isInAnyAsyncThread() method.

Does anyone have any suggestions?

Thanks

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [July 24, 2014, 6:41am UTC](https://qa.fmod.com/t/releasing-events-event/11572/2 "2014-07-24T06:41:48Z")

</div>

> [@](#):
>
> Hi.  
> I’m trying to implement an audio system based on the FMOD Studio API examples, and i’m having issues with releasing any of my EventInstances.
> 
> I have everything working, and my sounds are playing fine, (including a looping music event), however if i start and immediately release an EventInstance, then I get an access exception. I’m effectively doing this (with additional result error checking of course)
> 
> ```
> instance->start();
> instance->release();
> 
> ```
> 
> If i don’t release the instance, then everything runs fine, however I assume that it’ll eventually run out of memory over time.
> 
> I’m checking and confirming that indeed the EventDescription is a OneShot event.
> 
> The same occurs if I stop and release a looping audio event, or ANY of my events for that matter.
> 
> I am working on iOS, and i get an “EXC\_BAD\_ACCESS” exception. It appears to be in the FMOD::AsyncManager::isInAnyAsyncThread() method.
> 
> Does anyone have any suggestions?
> 
> Thanks

What version of FMOD Studio runtime are you using?

---

<div class="post-metadata">

**Author:** ![buzzrick](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/buzzrick/32/473_2.png) [@buzzrick](https://qa.fmod.com/u/buzzrick)\
**Post date:** [July 24, 2014, 9:09pm UTC](https://qa.fmod.com/t/releasing-events-event/11572/3 "2014-07-24T21:09:27Z")

</div>

I downloaded the latest a day or so ago: v1.04.04

---

<div class="post-metadata">

**Author:** ![buzzrick](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/buzzrick/32/473_2.png) [@buzzrick](https://qa.fmod.com/u/buzzrick)\
**Post date:** [July 29, 2014, 12:33am UTC](https://qa.fmod.com/t/releasing-events-event/11572/4 "2014-07-29T00:33:20Z")

</div>

It turns out I wasn’t linking the lib files correctly. I was missing the linker flags in my Xcode configuration.

> Add “-lfmodL\_$PLATFORM\_NAME” and “-lfmodstudioL\_$PLATFORM\_NAME” to “Other Linker Flags” (in the “Linker” section)

It was weird because it _appeared_ to be working fine even though I apparently wasn’t even linking the FMOD libs.

The post from markmarijnissen at [http://52.88.2.202/questions/question/forum-39077](http://52.88.2.202/questions/question/forum-39077) helped a lot on how to correctly set up FMOD in an Xcode project.
