# C++ core api memory leaks. Is there some standard procedure or document of release objects?

**URL:** <https://qa.fmod.com/t/c-core-api-memory-leaks-is-there-some-standard-procedure-or-document-of-release-objects/17041>\
**Category:** FMOD Engine\
**Tags:** cpp\
**Created:** [April 13, 2021, 9:45am UTC](https://qa.fmod.com/t/c-core-api-memory-leaks-is-there-some-standard-procedure-or-document-of-release-objects/17041 "2021-04-13T09:45:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zcguan](https://avatars.discourse-cdn.com/v4/letter/z/f14d63/32.png) [@zcguan](https://qa.fmod.com/u/zcguan)\
**Post date:** [April 13, 2021, 9:45am UTC](https://qa.fmod.com/t/c-core-api-memory-leaks-is-there-some-standard-procedure-or-document-of-release-objects/17041/1 "2021-04-13T09:45:23Z")

</div>

Using `FMOD_Memory_GetStats`, I find there is memory leak in my fmod procedure. I have constructed a very complex graph but I only release the sound and the system at the end. I guess it is because the tens of DSP I created.

Do I need to remove the DSP I created one by one at the end? If so, is there a convenient way of releasing all memory when I release the system?

Here is the graph.

 ![fmod_prof](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/4/452518ea7ee6c3cae4c73119e6ed29387a2adce9.png)

---

<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:** [April 19, 2021, 12:03am UTC](https://qa.fmod.com/t/c-core-api-memory-leaks-is-there-some-standard-procedure-or-document-of-release-objects/17041/2 "2021-04-19T00:03:18Z")

</div>

You need to make sure any Sound, ChannelGroup, Geometry and DSP objects are released before calling `System::close/release`. You will also need to make sure your DSPs have been removed ([ChannelControl::removedsp](https://fmod.com/resources/documentation-api?version=2.2&page=core-api-channelcontrol.html#channelcontrol_removedsp)) before you can release it.

> [FMOD - Core API Reference | System (system close)](https://fmod.com/resources/documentation-api?version=2.2&page=core-api-system.html#system_close)  
> Closing renders objects created with this System invalid. Make sure any Sound, ChannelGroup, Geometry and DSP objects are released before calling this.

> [FMOD - Core API Reference | DSP (dsp release)](https://fmod.com/resources/documentation-api?version=2.2&page=core-api-dsp.html#dsp_release)  
> Closing renders objects created with this System invalid. Make sure any Sound, ChannelGroup, Geometry and DSP objects are released before calling this.
