d3d10core: Only destroy the device when it doesn't have any references left.

Henri Verbeet hverbeet at codeweavers.com
Mon Mar 23 02:30:17 CDT 2009


---
 dlls/d3d10core/device.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c
index 1406c38..7320f92 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;
 }
-- 
1.6.0.6



--------------080905090701080401090205--



More information about the wine-patches mailing list