d2d1: Check for NULL pointer when releasing previous render target view.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6ab887c057
commit
621675e8f8
|
@ -2375,6 +2375,7 @@ HRESULT d2d_d3d_render_target_create_rtv(ID2D1RenderTarget *iface, IDXGISurface1
|
|||
|
||||
render_target->pixel_size.width = surface_desc.Width;
|
||||
render_target->pixel_size.height = surface_desc.Height;
|
||||
if (render_target->view)
|
||||
ID3D10RenderTargetView_Release(render_target->view);
|
||||
render_target->view = view;
|
||||
|
||||
|
|
|
@ -3129,6 +3129,7 @@ static void test_hwnd_target(void)
|
|||
ID2D1HwndRenderTarget *rt;
|
||||
ID2D1Factory *factory;
|
||||
ID3D10Device1 *device;
|
||||
D2D1_SIZE_U size;
|
||||
HRESULT hr;
|
||||
|
||||
if (!(device = create_device()))
|
||||
|
@ -3166,6 +3167,11 @@ static void test_hwnd_target(void)
|
|||
hr = ID2D1Factory_CreateHwndRenderTarget(factory, &desc, &hwnd_rt_desc, &rt);
|
||||
ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
|
||||
|
||||
size.width = 128;
|
||||
size.height = 64;
|
||||
hr = ID2D1HwndRenderTarget_Resize(rt, &size);
|
||||
ok(SUCCEEDED(hr), "Failed to resize render target, hr %#x.\n", hr);
|
||||
|
||||
ID2D1HwndRenderTarget_Release(rt);
|
||||
|
||||
DestroyWindow(hwnd_rt_desc.hwnd);
|
||||
|
|
Loading…
Reference in New Issue