Henri Verbeet : ddraw: Destroy the swapchain after the D3D device in DllMain().

Alexandre Julliard julliard at winehq.org
Mon Dec 12 12:25:53 CST 2011


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Sun Dec 11 21:43:28 2011 +0100

ddraw: Destroy the swapchain after the D3D device in DllMain().

---

 dlls/ddraw/main.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c
index 9d5bb53..1477913 100644
--- a/dlls/ddraw/main.c
+++ b/dlls/ddraw/main.c
@@ -941,9 +941,6 @@ DllMain(HINSTANCE hInstDLL,
                 IDirectDraw4_AddRef(&ddraw->IDirectDraw4_iface);
                 IDirectDraw7_AddRef(&ddraw->IDirectDraw7_iface);
 
-                if (ddraw->wined3d_swapchain)
-                    ddraw_destroy_swapchain(ddraw);
-
                 /* Does a D3D device exist? Destroy it
                     * TODO: Destroy all Vertex buffers, Lights, Materials
                     * and execute buffers too
@@ -954,6 +951,12 @@ DllMain(HINSTANCE hInstDLL,
                     while(IDirect3DDevice7_Release(&ddraw->d3ddevice->IDirect3DDevice7_iface));
                 }
 
+                /* Destroy the swapchain after any 3D device. The 3D device
+                 * cleanup code needs a swapchain. Specifically, it tries to
+                 * set the current render target to the front buffer. */
+                if (ddraw->wined3d_swapchain)
+                    ddraw_destroy_swapchain(ddraw);
+
                 /* Try to release the objects
                     * Do an EnumSurfaces to find any hanging surfaces
                     */




More information about the wine-cvs mailing list