First post, by atom0s
Hello, fellow developer here wanting to report a bug I am noticing with some of my personal software. While users of my modifications are using dgVoodoo they are experiencing high memory usage and crashes due to a memory leak.
I got dgVoodoo to confirm the issue and am able to reproduce it both in the actual game I make modifications for as well as a simple D3D8 test window that does some basic drawing.
Specifically, there appears to be a memory leak with IDirect3DDevice8::CreateStateBlock.
Example of recreating the bug/leak:
// Create a state block of all information..
DWORD stateBlockToken = 0;
device->CreateStateBlock(D3DSBT_ALL, &stateBlockToken);
// Scene adjustments and rendering here..
// Restore the state block..
device->ApplyStateBlock(stateBlockToken);
device->DeleteStateBlock(stateBlockToken);
CreateStateBlock will allocate space that does not appear to be cleaned up properly when calling DeleteStateBlock.