Skip to content

Commit

Permalink
Fix engineRequestModel crash caused by CResourceModelStreamer (#3675)
Browse files Browse the repository at this point in the history
* Fix crash

* Fix refs count

* Use reference

---------

Co-authored-by: TEDERIs <[email protected]>
  • Loading branch information
TheNormalnij and tederis authored Aug 26, 2024
1 parent 5508c7e commit 295844a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Client/mods/deathmatch/logic/CResourceModelStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ void CResourceModelStreamer::ReleaseAll()

void CResourceModelStreamer::FullyReleaseModel(std::uint16_t modelId)
{
std::uint16_t &refsCount = m_requestedModels[modelId];
auto refs = m_requestedModels.find(modelId);
if (refs == m_requestedModels.end())
return;

std::uint16_t& refsCount = refs->second;

if (refsCount > 0)
{
Expand Down

0 comments on commit 295844a

Please sign in to comment.