Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/surface.c:
- if (image_is_argb(bitmap_frame, info))
info->Format = D3DFMT_A8R8G8B8;
- info->Depth = 1;
- info->MipLevels = 1;
- info->ResourceType = D3DRTYPE_TEXTURE;
+exit:
- if (is_dib) free((void *)src_image);
- if (wic_factory) IWICImagingFactory_Release(wic_factory);
- if (wic_stream) IWICStream_Release(wic_stream);
- if (bitmap_decoder) IWICBitmapDecoder_Release(bitmap_decoder);
- if (bitmap_frame) IWICBitmapFrameDecode_Release(bitmap_frame);
- return hr;
+}
More general style comments: - we usually put the "release" calls in reverse order of allocation - `if ()` body on its own line
BTW, definitely moving all the cleanup at the end of the function makes for nicer code, I approve :thumbsup: