Server memory leak in 2.02.03 UE 4.26 integration

Hi,

We have been investigating memory leaks on dedicated server, and found a small leak in UFMODBlueprintStatics::PlayEventAttached. On dedicated server, it results in a new UFMODAudioComponent being created for each call, many of which are never cleaned up since the sounds do not actually play. On our side we are adding this to the top of the function:

	if (!FApp::CanEverRenderAudio())
	{
		return nullptr;
	}

I’m curious to see if there is any feedback on this fix and whether another fix would be more appropriate.

Note that we found this with 2.02.03 on 4.26, but the same bug appears to be there on 2.02.05 on 4.27.

Thanks,
Dan

Thank you for flagging, I have passed this along to the Dev team to fix up in a future release.
I think your solution makes sense, we return nullptr in a few other cases and that doesn’t seem to be causing issues in those situations. Maybe this would be a little more semantically tied to the FMOD API:

if(!IFMODStudioModule::Get().UseSound())
{
    return nullptr;
}