While previous pull request fixed most of the issues the one remained:
DedicatedCache::DestroyDedicatedCache() call can happen right between DedicatedCache::CollectStatistics() call and any code that makes use of statistics collected (e.g. System.cpp @ 1745 or Device.cpp @ 96). This leads to accessing invalid memory through string views stored in statistics values and, particularly, to crashes on consoles.
The solution proposed (apart form guarding internal data members with locks) is to postpone removal of m_cachedStatNames entries until the very beginning of the next DedicatedCache::CollectStatistics() call.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
More fixes for problems addressed by https://github.com/aws/lumberyard/pull/494
While previous pull request fixed most of the issues the one remained:
DedicatedCache::DestroyDedicatedCache()
call can happen right betweenDedicatedCache::CollectStatistics()
call and any code that makes use of statistics collected (e.g.System.cpp @ 1745
orDevice.cpp @ 96
). This leads to accessing invalid memory through string views stored in statistics values and, particularly, to crashes on consoles.The solution proposed (apart form guarding internal data members with locks) is to postpone removal of
m_cachedStatNames
entries until the very beginning of the nextDedicatedCache::CollectStatistics()
call.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.