From 27a6bb5f081c6f1b5c48f2346ee6d35a138ba776 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 23 Mar 2009 08:30:17 +0100 Subject: [PATCH] d3d10core: Only destroy the device when it doesn't have any references left. --- dlls/d3d10core/device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index 1406c38ddf6..7320f92b9f2 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -75,7 +75,10 @@ static ULONG STDMETHODCALLTYPE d3d10_device_inner_Release(IUnknown *iface) TRACE("%p decreasing refcount to %u\n", This, refcount); - if (This->wined3d_device) IWineD3DDevice_Release(This->wined3d_device); + if (!refcount) + { + if (This->wined3d_device) IWineD3DDevice_Release(This->wined3d_device); + } return refcount; }