From: Luca Barbieri Date: Thu, 23 Sep 2010 01:10:50 +0000 (+0200) Subject: d3d1x: properly reference count the backend X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=881c05aa1ec22bb229a0bceae372d68f9fc91431;p=mesa.git d3d1x: properly reference count the backend --- 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?