Skip to content

[FIX] Avoid multiplied hud release callback calls.#2109

Open
Neloreck wants to merge 2 commits into
OpenXRay:devfrom
xray-forge:dev-fix-release-hud-duplicates
Open

[FIX] Avoid multiplied hud release callback calls.#2109
Neloreck wants to merge 2 commits into
OpenXRay:devfrom
xray-forge:dev-fix-release-hud-duplicates

Conversation

@Neloreck

@Neloreck Neloreck commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Hoists g_pGameLevel->pHUD->net_Relcase(dit) out of the relcase callbacks loop into its own loop over destroy_queue in CObjectList::Update.

Notes

  • The HUD notification was nested inside the m_relcase_callbacks iteration in CObjectList::Update, so pHUD->net_Relcase executed registered callbacks × destroyed objects times. Profiling a regular Call of Pripyat session with Tracy showed 847,150 CHUDManager::net_Relcase calls for 1,747 destroyed objects (~485 registered relcase callbacks).
  • The misplacement predates OpenXRay .
  • CHUDManager::net_Relcase only drops cached references to the destroyed object (HitMarker, m_pHUDTarget), so moving it after the callbacks loop is order-independent.
  • Edge-case behavior change: with zero registered relcase callbacks the HUD was previously never notified at all; it is now always notified once per destroyed object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant