residualvm/residualvm — Issue #486: GRIM: Colors are allocated but never deallocated
Author: klusark
Created: 2012-01-18 05:47:23+00:00
State: open

Every time MakeColor is called, a new color object is created. When the menu is opened at least one new color object is created. If you were to open and close the menu repeatedly the memory would grow every time.

Additionally, when you create a save game all the current colors are added to it, making save games get larger every time the menu is opened.

One solution would be to change the id's in PoolColor to something like MKTAG(0, r, g, b) in order for it to only create each color once.