Нашёл причину утечки памяти
This commit is contained in:
1 parent
60c28f54f2
commit
320847af5b
229 files changed
+3094
-18282
No files matched your search
@@ -73,10 +73,15 @@ namespace Code.Infrastructure.Audio
|
||||
public void ReleaseAudios(AudioNames groupName)
|
||||
{
|
||||
UnityEngine.Debug.LogWarning($"Audios unloaded {groupName}");
|
||||
_eventBus.RaiseEvent<IAudioClipsEventHandle>(x=> x.AudioClipsUnLoaded(groupName));
|
||||
|
||||
if (_clipsHandles[groupName].Count == 0) return;
|
||||
|
||||
foreach (var handle in _clipsHandles)
|
||||
foreach (var handle in _clipsHandles[groupName])
|
||||
Addressables.Release(handle.Value);
|
||||
|
||||
_clipsHandles[groupName].Clear();
|
||||
|
||||
_eventBus.RaiseEvent<IAudioClipsEventHandle>(x=> x.AudioClipsUnLoaded(groupName));
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
@@ -87,7 +92,8 @@ namespace Code.Infrastructure.Audio
|
||||
handle.Value.Release();
|
||||
}
|
||||
}
|
||||
|
||||
_clipsHandles.Clear();
|
||||
|
||||
_configsHandle.Release();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user