git.s-ol.nu ~forks/DiligentTools / 1526355
GLTF resource manager: fixed issue with allocation cache not being protected by mutex assiduous 11 months ago
1 changed file(s) with 4 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
125125
126126 if (CacheId != nullptr && *CacheId != 0)
127127 {
128 auto inserted = m_TexAllocations.emplace(CacheId, pAllocation).second;
129 VERIFY_EXPR(inserted);
128 std::lock_guard<std::mutex> Lock{m_TexAllocationsMtx};
129 // Note that the same allocation may potentially be created by more
130 // than one thread if it has not been found in the cache originally
131 m_TexAllocations.emplace(CacheId, pAllocation).second;
130132 }
131133
132134 return pAllocation;