So I have a reference type where i register the asBEHAVE_ADDREF and asBEHAVE_RELEASE behaviours, and I construct this reference type in C++. So in AngelScript I have a C++ method that returns this reference type, but if I never assign the returned value to anything the reference behaviours are never called so the object never gets deleted. Is there something I can do to detect this or have I done something wrong?
So basically this leaks memory:
sound.Play2D();
and this does not:
SoundInstance@ si = sound.Play2D();