[host] fix failure to re-init

This commit is contained in:
Geoffrey McRae 2018-10-19 21:15:04 +11:00
parent 6a9f687eae
commit 31a25c94c6

View File

@ -55,11 +55,14 @@ bool DXGI::Initialize(CaptureOptions * options)
m_options = options; m_options = options;
HRESULT status; HRESULT status;
m_cursorRPos = 0;
m_cursorWPos = 0;
for (int i = 0; i < _countof(m_cursorRing); ++i) for (int i = 0; i < _countof(m_cursorRing); ++i)
{ {
m_cursorRing[i].visible = false; CursorInfo & cursor = m_cursorRing[i];
m_cursorRing[i].hasPos = false; cursor.visible = false;
m_cursorRing[i].hasShape = false; cursor.hasPos = false;
cursor.hasShape = false;
} }
status = CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void **)(&m_dxgiFactory)); status = CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void **)(&m_dxgiFactory));
@ -324,7 +327,8 @@ void DXGI::DeInitialize()
{ {
if (m_cursorRing[i].shape.buffer) if (m_cursorRing[i].shape.buffer)
delete[] m_cursorRing[i].shape.buffer; delete[] m_cursorRing[i].shape.buffer;
m_cursorRing[i].shape.buffer = NULL; m_cursorRing[i].shape.buffer = NULL;
m_cursorRing[i].shape.bufferSize = 0;
} }
for(int i = 0; i < _countof(m_texture); ++i) for(int i = 0; i < _countof(m_texture); ++i)