I’m creating a game/game engine with procedurally generated environments - as part of that system all rooms/structures also have a reverb zone and unique sound geometry. When the player moves old structures are dynamically removed and new structures are built.
I have a queue of ReverbZones (which have geometry ptrs as a member) to be deleted so I can control when the memory is released. On rare occasions (I maybe get this bug every few hours of normal player movement) when geometry->release() is called the entire program will hang for an indefinite amount of time. I don’t get an FMOD_RESULT back from the call as the main thread is blocked/frozen somewhere in FMOD::Geometry*->release(). I have tried ensuring that the geometry cleanup is happening strictly before all other parts of FMOD updating, and also I have tried doing it strictly after - but it seems to make no difference. I was thinking perhaps geometry is trying to be released twice somehow but this is not possible as I eval if its nullptr and set it to nullptr after release.
Would appreciate any advice on this - its a hard bug to replicate but quite a nasty one since it causes the entire program to hang. At this point I’m considering maybe multi-threading the delete/release process just so I can ensure main thread is not blocked.