[PATCH] d3d8/tests: Fix resource leak.
Józef Kucia
joseph.kucia at gmail.com
Mon Jan 15 11:22:08 CST 2018
On Mon, Jan 15, 2018 at 6:16 PM, Andrey Gusev <andrey.goosev at gmail.com> wrote:
> Signed-off-by: Andrey Gusev <andrey.goosev at gmail.com>
> ---
> dlls/d3d8/tests/device.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
> index a9188f0ee4..e372c25dc8 100644
> --- a/dlls/d3d8/tests/device.c
> +++ b/dlls/d3d8/tests/device.c
> @@ -8514,6 +8514,7 @@ START_TEST(device)
> || current_mode.dmPelsHeight != registry_mode.dmPelsHeight)
> {
> skip("Current mode does not match registry mode, skipping test.\n");
> + FreeLibrary(d3d8_handle);
> return;
> }
>
> @@ -8527,6 +8528,7 @@ START_TEST(device)
> if (!(d3d8 = Direct3DCreate8(D3D_SDK_VERSION)))
> {
> skip("could not create D3D8\n");
> + FreeLibrary(d3d8_handle);
> return;
> }
> IDirect3D8_Release(d3d8);
> @@ -8602,4 +8604,5 @@ START_TEST(device)
> test_clip_planes_limits();
>
> UnregisterClassA("d3d8_test_wc", GetModuleHandleA(NULL));
> + FreeLibrary(d3d8_handle);
> }
> --
> 2.13.6
>
>
>
I think it would be better to use GetModuleHandle() instead of LoadLibrary().
More information about the wine-devel
mailing list