- Home /
How to release an AudioClip addressable?
I would like to release my AudioClip addressable after using it.
To better understand addressables I created a simple test scene:
private AsyncOperationHandle<AudioClip> _handle;
private async Task TempAsync()
{
_handle = Addressables.LoadAssetAsync<AudioClip>(audioClipPath);
await _handle.Task;
// Expected ref count: 1 Actual: 7
Addressables.Release(_handle);
// Expected ref count: 0 Actual: 3
}
Why is the ref count 7 instead of 1 after LoadAssetAsync
?
Why is the ref count 3 instead of 0 after Release
?
I am using Unity 2019.2.21f1 Personal and Addressables 1.2.4.
audio-addressable-ref-count.png
(89.6 kB)
Comment
Answer by felixmann · Dec 06, 2020 at 06:10 PM
Updating to addressables 1.16.15 resolved the issue. Now after Addressables.Release()
I have a ref count of 0 :)
(The ref count after Addressables.LoadAssetAsync()
is now 6 instead of the expected 1, but meh.)
Your answer
![](https://koobas.hobune.stream/wayback/20220613021151im_/https://answers.unity.com/themes/thub/images/avi.jpg)