Skip to content

[GEN][ZH] Fix Memory Manager initialization issues #1236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xezon
Copy link

@xezon xezon commented Jul 6, 2025

This change fixes Memory Manager initialization issues.

Problems identified: ClientInstance::initialize and CommandLine::parseCommandLineForStartup both used 'new' allocator before the Memory Manager was initialized, in both Debug and Release. This caused the Memory Manager to actually be created twice, and trigger 1 assert on game launch and 1 assert on game quit.

This is now fixed by fixing initialization ordering and preventing some allocations with 'new'.

This change also uses the stl::malloc_allocator that was added to the pending Pull Request #1066.

TODO

  • Replicate in Generals

@xezon xezon requested a review from helmutbuhler July 6, 2025 20:18
@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project Memory Is memory related Fix Is fixing something, but is not user facing labels Jul 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Is fixing something, but is not user facing Memory Is memory related Minor Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix debug memory crash on exit in VS22 due to recent TheGlobalData refactor
1 participant