Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/texture.c:
else
{
*texture = tex;
IDirect3DTexture9_AddRef(tex);
}
if (srcinfo) *srcinfo = imginfo;
+exit:
- if (buf_tex)
IDirect3DTexture9_Release(buf_tex);
- if (tex)
IDirect3DTexture9_Release(tex);
- return D3D_OK;
- return hr;
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: ```suggestion:-6+0 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?