Does FMOD have a garbage collector?

I need to keep event instances around so I can stop music before I start a new music event. However, when working in blueprint I can only find a “Stop” method for the Event Instance, not the “Release” method that I see mentioned in the C++ API.

The issue is that as I start playing the new music event, I replace the Event Instance variable with the event instance of the new music. So I no longer have a reference to the old music event instance.

Will this unreferenced, unused event instance be cleaned up by a garbage collector once it’s clear that it’s neither playing any sounds nor being stored by any variable, or am I going to have to write C++ if I want to deallocate the memory used by the old music event instance?

1 Like

Thanks for bringing this up, FMOD will only clean up Event Instances when the System is destroyed/released, so until that point the instances will be leaking.

I have added a task to add a node for releasing Event Instances.

1 Like