xna-cncnet-client
xna-cncnet-client copied to clipboard
Fix memory leak in game lobby color dropdown textures
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.