On Wed Jun 12 17:22:54 2024 +0000, Matteo Bruni wrote:
This is fine. I wonder, though, if it wouldn't be nicer to keep a separate path for the error case and avoid those `AddRef()`s. Something like:
return hr; err: if (buf_tex) IDirect3DTexture9_Release(buf_tex); if (tex) IDirect3DTexture9_Release(tex); return hr;
This would require duplicating the `d3dx_image_cleanup(&image);` in both exit paths in the next patch, but maybe that's still nicer overall?
I've changed it to be more in line with what you've posted here, let me know if it's better. :)