This is a proposal to fix the issue outlined in https://github.com/crosire/d3d8to9/issues/155. Basically, D3D8.1 and D3D9 lifetimes have different rules but d3d8to9 currently doesn't follow the D3D8.1 behavior (which is that shaders share a lifetime with the device that created them and are implicitly destroyed). This causes some D3D8 applications to leak shader and device objects even if they are well behaved under plain D3D8.x.
This is a proposal to fix the issue outlined in https://github.com/crosire/d3d8to9/issues/155. Basically, D3D8.1 and D3D9 lifetimes have different rules but d3d8to9 currently doesn't follow the D3D8.1 behavior (which is that shaders share a lifetime with the device that created them and are implicitly destroyed). This causes some D3D8 applications to leak shader and device objects even if they are well behaved under plain D3D8.x.
Here is a test that shows this behavior: d3d8_refcounttest.zip