You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#2740 removed function GameClient::updateHeadless, which ensured that particle systems wouldn't accumulate and take up a lot of memory unnecessarily. This works when ParticleSystemManagerDummy overloads the init function, but that's not possible with retail compatibility.
This PR adds a dummy overload for createParticleSystem, so that no particle systems get created in headless mode.
I tested > 2500 short replays and did not see a mismatch because of this change.
Caball009
added
Minor
Severity: Minor < Major < Critical < Blocker
Gen
Relates to Generals
ZH
Relates to Zero Hour
ThisProject
The issue was introduced by this project, or this task is specific to this project
Memory
Is memory related
labels
Jul 22, 2026
This PR fixes a memory accumulation issue in headless mode introduced when GameClient::updateHeadless was removed: in RETAIL_COMPATIBLE_CRC builds, ParticleSystemManagerDummy can no longer override init() to skip template loading (needed for CRC correctness), so particle systems created during replays were never cleaned up. The fix makes createParticleSystem virtual in the base class and adds a dummy override that immediately returns nullptr, short-circuiting all particle system creation without affecting template loading.
createParticleSystem is conditionally marked virtual only under RETAIL_COMPATIBLE_CRC, and all existing call sites already null-check the return value, so the change is safe throughout the engine.
The #else (non-retail) branch formatting diverges slightly from the surrounding codebase pointer style (Type* vs Type *).
Confidence Score: 5/5
Safe to merge — the change is surgical and all existing call sites already null-check the return value of createParticleSystem.
The virtual override cleanly short-circuits particle system creation in headless retail mode, and every engine call site that invokes createParticleSystem already guards against a nullptr result, so no downstream breakage is possible. The non-retail path is untouched in behavior.
No files require special attention.
Important Files Changed
Filename
Overview
Core/GameEngine/Include/GameClient/ParticleSys.h
Adds a virtual createParticleSystem override to ParticleSystemManagerDummy under RETAIL_COMPATIBLE_CRC that returns nullptr, preventing particle system accumulation in headless mode without disturbing template loading needed for CRC compatibility. Minor pointer-style inconsistency introduced in the #else branch.
Sequence Diagram
sequenceDiagram
participant Caller
participant TPSM as TheParticleSystemManager<br/>(ParticleSystemManagerDummy)
participant PSM as ParticleSystemManager
Note over TPSM: RETAIL_COMPATIBLE_CRC mode
Caller->>TPSM: createParticleSystem(sysTemplate, createSlaves)
Note over TPSM: virtual override — returns nullptr immediately
TPSM-->>Caller: nullptr (no system created, no accumulation)
Note over PSM: Non-retail mode
Caller->>PSM: createParticleSystem(sysTemplate, createSlaves)
Note over PSM: init() no-op → no templates loaded<br/>sysTemplate == nullptr → early return
PSM-->>Caller: nullptr
Caball009
changed the title
bugfix(particlesys): Prevent accumulation of particle systems in headless mode
fix(particlesys): Prevent accumulation of particle systems in headless mode
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FixIs fixing something, but is not user facingGenRelates to GeneralsMemoryIs memory relatedMinorSeverity: Minor < Major < Critical < BlockerThisProjectThe issue was introduced by this project, or this task is specific to this projectZHRelates to Zero Hour
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#2740 removed function
GameClient::updateHeadless, which ensured that particle systems wouldn't accumulate and take up a lot of memory unnecessarily. This works whenParticleSystemManagerDummyoverloads theinitfunction, but that's not possible with retail compatibility.This PR adds a dummy overload for
createParticleSystem, so that no particle systems get created in headless mode.I tested > 2500 short replays and did not see a mismatch because of this change.