Skip to content

fix(worldheightmap): Free the legacy cliff state buffer when loading blend tile data - #3482

Merged
xezon merged 1 commit into
TheSuperHackers:mainfrom
tintinhamans:arctic/fix/blend-tile-buffer-leak
Oct 13, 2026
Merged

xezon merged 1 commit into
TheSuperHackers:mainfrom
tintinhamans:arctic/fix/blend-tile-buffer-leak

Conversation

@tintinhamans

@tintinhamans tintinhamans commented Oct 11, 2026 •

Copy link
Copy Markdown

ParseBlendTileData reads version 7 cliff flags through a temporary buffer, because Generals wrote the rows with a narrower stride than the in-memory layout, and never frees it. About 32 KB per 512x512 map.

Version 7 is what the Generals WorldBuilder writes, so this fires on every map load in Generals and on Generals-era community maps in Zero Hour. The 116 shipped Zero Hour maps are all version 8.

Other issues with loading Generals maps in ZH (#1772) will be handled in follow-up.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1f8116d9-0bc0-4e53-b74d-3d87e1910a0a
📥 Commits

Reviewing files that changed from the base of the PR and between 239de3e and 9d4c1dd.

📒 Files selected for processing (1)
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The legacy blend-tile version 7 loading path now frees its temporary cliff-state buffer after copying the data into m_cellCliffState.

Changes

Legacy blend-tile loading

Layer / File(s) Summary
Free the temporary cliff-state buffer
Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp
The version 7 parser deletes the temporary buffer after copying its contents into m_cellCliffState.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: xezon

Merge Risk: ⚪ Minimal · up to 9d4c1

The version-7 loading path now frees its temporary buffer after copying the data. No actionable merge-blocking risk remains.

Pre-merge checks · Passed 4
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: freeing the legacy cliff-state buffer during blend tile data loading.
Description check Passed The description directly explains the buffer leak, its cause, affected map versions, and scope of follow-up work.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

Frees the temporary cliff-flag buffer after ParseBlendTileData copies version 7 map data.

  • Version 7 map loads free the temporary cliff-state buffer.

Reviews (2) · Last reviewed commit: "bugfix(terrain): Free the legacy cliff s..." · Reviewed by Greptile

@tintinhamans tintinhamans added Bug Something is not working right, typically is user facing Gen Relates to Generals ZH Relates to Zero Hour Rendering Is Rendering related Memory Is memory related labels Oct 11, 2026

@Mauller Mauller left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A cliff hanger

Comment thread Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp Outdated
@tintinhamans
tintinhamans force-pushed the arctic/fix/blend-tile-buffer-leak branch from 239de3e to 9d4c1dd Compare October 13, 2026 07:25
@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker and removed Rendering Is Rendering related labels Oct 13, 2026
@xezon xezon changed the title bugfix(terrain): Free the legacy cliff state buffer when loading blend tile data fix(terrain): Free the legacy cliff state buffer when loading blend tile data Oct 13, 2026
@xezon xezon changed the title fix(terrain): Free the legacy cliff state buffer when loading blend tile data fix(worldheightmap): Free the legacy cliff state buffer when loading blend tile data Oct 13, 2026
@xezon
xezon merged commit a5780c8 into TheSuperHackers:main Oct 13, 2026
25 checks passed
gamezerve pushed a commit to gamezerve/Reborn-Omega that referenced this pull request Oct 13, 2026
@tintinhamans
tintinhamans deleted the arctic/fix/blend-tile-buffer-leak branch October 14, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Gen Relates to Generals Memory Is memory related Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants