GWToolboxpp
GWToolboxpp copied to clipboard
Better memory management of Resource image handles
Functions like Resources::GetGuildWarsWikiImage are being used in modules like the Target Info Window - these images aren't being freed until toolbox closes (and its a d3d managed pointer so maybe not even then!), so the memory footprint of the game will steadily increase as more textures are added
Instead of returning a IDirect3DTexture9** from these functions, we should be wrapping it in its own handle where we manage reference count and free the underlying texture when the reference count is 0
This is a big change because things like the completion window module would now need to explicitly tell this new handle that it doesn't need the texture any more.