d3d1x: properly reference count the backend
authorLuca Barbieri <luca@luca-barbieri.com>
Thu, 23 Sep 2010 01:10:50 +0000 (03:10 +0200)
committerLuca Barbieri <luca@luca-barbieri.com>
Thu, 23 Sep 2010 01:13:52 +0000 (03:13 +0200)
src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp

index 3cbe056e7b6d0bf7394a0a0b707cc0a60ce26e69..2149d83a9c600c7a7eb55b53985be232099546b4 100644 (file)
@@ -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?