Skip to content

[GEN][ZH] Fix memory leak in SpecialAbilityUpdate::isWithinStartAbilityRange() #845

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

Merged

Conversation

xezon
Copy link

@xezon xezon commented May 11, 2025

This change fixes a minor memory leak in SpecialAbilityUpdate::isWithinStartAbilityRange(). It is reproducible when using the China Hacker to disable buildings.

Leaked a block of size 16, tagstring D:\Projects\TheSuperHackers\GeneralsGameCode\GeneralsMD\Code\GameEngine\Source\GameLogic\Object\SimpleObjectIterator.cpp, from pool/dma SimpleObjectIteratorClumpPool
Leaked a block of size 16, tagstring D:\Projects\TheSuperHackers\GeneralsGameCode\GeneralsMD\Code\GameEngine\Source\GameLogic\Object\SimpleObjectIterator.cpp, from pool/dma SimpleObjectIteratorClumpPool
Leaked a block of size 16, tagstring D:\Projects\TheSuperHackers\GeneralsGameCode\GeneralsMD\Code\GameEngine\Source\GameLogic\Object\SimpleObjectIterator.cpp, from pool/dma SimpleObjectIteratorClumpPool
...
Leaked a block of size 16, tagstring D:\Projects\TheSuperHackers\GeneralsGameCode\GeneralsMD\Code\GameEngine\Source\GameLogic\Object\PartitionManager.cpp, from pool/dma SimpleObjectIteratorPool
Leaked a block of size 16, tagstring D:\Projects\TheSuperHackers\GeneralsGameCode\GeneralsMD\Code\GameEngine\Source\GameLogic\Object\PartitionManager.cpp, from pool/dma SimpleObjectIteratorPool
Leaked a block of size 16, tagstring D:\Projects\TheSuperHackers\GeneralsGameCode\GeneralsMD\Code\GameEngine\Source\GameLogic\Object\PartitionManager.cpp, from pool/dma SimpleObjectIteratorPool
...
ASSERTION FAILURE: There were 5089 memory leaks. Please fix them.

@xezon xezon added this to the Stability fixes milestone May 11, 2025
@xezon xezon added Bug Something is not working right Minor Severity: Minor < Major < Critical < Blocker Memory Is memory related labels May 11, 2025
Copy link

@Mauller Mauller left a comment

Choose a reason for hiding this comment

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

Looks good, checked this out and could see these being leaked every time the hackers started a new hacking session when disabling the building.

@xezon xezon merged commit 4154e9e into TheSuperHackers:main May 11, 2025
18 checks passed
@xezon xezon deleted the xezon/fix-specialabilityupdate-memory-leak branch May 11, 2025 15:43
@xezon xezon added Gen Relates to Generals ZH Relates to Zero Hour labels May 16, 2025
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 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.

2 participants