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

Alexandre Julliard julliard at winehq.org
Mon Mar 23 12:34:53 CDT 2009


Module: wine
Branch: master
Commit: 27a6bb5f081c6f1b5c48f2346ee6d35a138ba776
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=27a6bb5f081c6f1b5c48f2346ee6d35a138ba776

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Mar 23 08:30:17 2009 +0100

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

---

 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;
 }




More information about the wine-cvs mailing list