win-capture: Release backbuffers immediately upon init

There's no need to keep a reference to the backbuffers.  That and the
backbuffer references weren't being released anyway, so that fixes that
bug.
This commit is contained in:
jp9000
2016-12-23 08:04:20 -08:00
parent 74a5bdf993
commit 21be33805d

View File

@@ -261,12 +261,9 @@ static inline bool d3d12_init_format(IDXGISwapChain *swap, HWND &window,
for (UINT i = 0; i < bb.count; i++) {
hr = swap->GetBuffer(i, __uuidof(ID3D12Resource),
(void**)&bb.backbuffer[i]);
if (FAILED(hr)) {
if (i > 0) {
for (UINT j = 0; j < i; j++) {
bb.backbuffer[j]->Release();
}
}
if (SUCCEEDED(hr)) {
bb.backbuffer[i]->Release();
} else {
return false;
}
}