From 9a789feb81f49c75b168d1f6a6406b2ede74cb1d Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 4 Jan 2017 00:04:48 +0100 Subject: [PATCH] wined3d: Only check rtv and dsv bindings in device_resource_released() when D3D is initialised. This fixes a regression introduced by commit 4a9304305ae2940288e9382926a6931dd46982d5. Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/device.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 785ea6badd0..3a24e2987ab 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4958,14 +4958,17 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); - for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) + if (device->d3d_initialized) { - if ((rtv = device->fb.render_targets[i]) && rtv->resource == resource) - ERR("Resource %p is still in use as render target %u.\n", resource, i); - } + for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) + { + if ((rtv = device->fb.render_targets[i]) && rtv->resource == resource) + ERR("Resource %p is still in use as render target %u.\n", resource, i); + } - if ((rtv = device->fb.depth_stencil) && rtv->resource == resource) - ERR("Resource %p is still in use as depth/stencil buffer.\n", resource); + if ((rtv = device->fb.depth_stencil) && rtv->resource == resource) + ERR("Resource %p is still in use as depth/stencil buffer.\n", resource); + } switch (type) {