RuntimeManager not tracking LoadedBank refcount correctly.

I’ve already sorted out a fix for this, but I just wanted to make you aware of it so other people don’t hit this issue. I’m using Unity integration 1.08.08, but this issue appears to still be present in the latest release (1.09.04).

In RuntimeManager’s LoadBank and UnloadBank methods, the result of incrementing or decrementing loadedBank.RefCount is not saved because loadedBank is a value type (struct) and not a reference type (class). The copy of loadedBank in the loadedBanks dictionary needs to be directly modified or replaced with the modified copy.

An easy reproduction of the issue is just to call LoadBank multiple times for a given bank and then call UnloadBank. No matter how many times LoadBank is called, the first call to UnloadBank always causes the bank to be unloaded due to the reference count being zero.

Sorry for the delayed response. You are correct, this is an issue.

I have added it to our tracker and will hopefully have a fix in the upcoming release.