d3d11: fix reference counting so devices get freed
authorLuca Barbieri <luca@luca-barbieri.com>
Mon, 27 Sep 2010 20:52:34 +0000 (22:52 +0200)
committerLuca Barbieri <luca@luca-barbieri.com>
Mon, 27 Sep 2010 21:43:53 +0000 (23:43 +0200)
src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h

index 9852dafa353e2ddd1b767326e8d91a2cd2ad0741..95ea4e00fc18e5816a5b52ee312edce40d275d6b 100644 (file)
@@ -145,6 +145,8 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen
 
 #if API >= 11
                immediate_context = GalliumD3D11ImmediateDeviceContext_Create(this, immediate_pipe, owns_immediate_pipe);
+               // release to the reference to ourselves that the immediate context took, to avoid a garbage cycle
+               immediate_context->Release();
 #endif
        }