xna-cncnet-client icon indicating copy to clipboard operation
xna-cncnet-client copied to clipboard

Fix memory leak in game lobby color dropdown textures

Open 11EJDE11 opened this issue 1 month ago • 1 comments

Refactor XNAClientColorDropDown to create color textures once at initialization and swap between them and DisabledItemTexture, rather than recreating textures every time the map changes. This prevents a memory leak caused by repeatedly creating new texture objects without disposing old ones.

To test the memory leak fix: Go to Skirmish lobby Choose first map Hold down arrow to scroll through all maps Check memory usage

With 8 players and 8 colors, 64 textures created each time and not disposed.

11EJDE11 avatar Nov 09 '25 13:11 11EJDE11