From 881c05aa1ec22bb229a0bceae372d68f9fc91431 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Thu, 23 Sep 2010 03:10:50 +0200 Subject: [PATCH] d3d1x: properly reference count the backend --- src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp b/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp index 3cbe056e7b6..2149d83a9c6 100644 --- a/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp +++ b/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp @@ -1381,7 +1381,11 @@ void STDMETHODCALLTYPE GalliumDXGIUseHDC(HDC hdc, PFNHWNDRESOLVER resolver, void */ void STDMETHODCALLTYPE GalliumDXGIMakeDefault() { + if(dxgi_default_binding.backend) + dxgi_default_binding.backend->Release(); dxgi_default_binding = dxgi_thread_binding; + if(dxgi_default_binding.backend) + dxgi_default_binding.backend->AddRef(); } /* TODO: why did Microsoft add this? should we do something different for DXGI 1.0 and 1.1? -- 2.30.2