From df6d3fcc7ec051872272ab14870cbba19c3af8e5 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 5 Apr 2006 04:10:03 +0000 Subject: [PATCH] rare crash that I havn't been able to repro: 6d9ab2a0: StepMania!00000000 77d48734: USER32!GetDC [77d40000+86c7+6d] 77d4d05b: USER32!EnumDisplayMonitors [77d40000+cf63+f8] 77d4b4c0: USER32!DefWindowProcW [77d40000+b33c+184] 77d4cf9e: USER32!EnumDisplayMonitors [77d40000+cf63+3b] 7c90eae3: ntdll!KiUserCallbackDispatcher [7c900000+ead0+13] 77d4daf6: USER32!DestroyWindow [77d40000+daea+c] 005ddc02: void GraphicsWindow::DestroyGraphicsWindow(void) 005de55e: void GraphicsWindow::Shutdown(void) 7c917304: ntdll!LdrUnloadDll [7c900000+1718b+179] 006716eb: RageDisplay_D3D::~RageDisplay_D3D(void) 0x6d9ab2a0 lies within D3D8.DLL, which LdrUnloadDll unloaded. --- stepmania/src/RageDisplay_D3D.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp index 672d8dfaaa..e38c3dd325 100644 --- a/stepmania/src/RageDisplay_D3D.cpp +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -293,6 +293,10 @@ RageDisplay_D3D::~RageDisplay_D3D() g_pd3d = NULL; } + GraphicsWindow::Shutdown(); + + /* Even after we call Release(), D3D may still affect our window. It seems to subclass + * the window, and never release it. Free the window after destroying the window. */ #if !defined(XBOX) if( g_D3D8_Module ) { @@ -300,8 +304,6 @@ RageDisplay_D3D::~RageDisplay_D3D() g_D3D8_Module = NULL; } #endif - - GraphicsWindow::Shutdown(); } void RageDisplay_D3D::GetDisplayResolutions( DisplayResolutions &out ) const