mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-10 22:33:58 +00:00
[dxgi] fix crash caused by failure to release in some instances.
This commit is contained in:
parent
3cd152c9d5
commit
73a2597c8a
1 changed files with 4 additions and 2 deletions
|
@ -353,8 +353,6 @@ GrabStatus Capture::DXGI::GrabFrameTexture(struct FrameInfo & frame, struct Curs
|
||||||
if (!m_initialized)
|
if (!m_initialized)
|
||||||
return GRAB_STATUS_ERROR;
|
return GRAB_STATUS_ERROR;
|
||||||
|
|
||||||
ReleaseFrame();
|
|
||||||
|
|
||||||
timeout = false;
|
timeout = false;
|
||||||
DXGI_OUTDUPL_FRAME_INFO frameInfo;
|
DXGI_OUTDUPL_FRAME_INFO frameInfo;
|
||||||
IDXGIResourcePtr res;
|
IDXGIResourcePtr res;
|
||||||
|
@ -364,6 +362,10 @@ GrabStatus Capture::DXGI::GrabFrameTexture(struct FrameInfo & frame, struct Curs
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
GrabStatus ret = ReleaseFrame();
|
||||||
|
if (ret != GRAB_STATUS_OK)
|
||||||
|
return ret;
|
||||||
|
|
||||||
status = m_dup->AcquireNextFrame(1000, &frameInfo, &res);
|
status = m_dup->AcquireNextFrame(1000, &frameInfo, &res);
|
||||||
if (status == DXGI_ERROR_WAIT_TIMEOUT)
|
if (status == DXGI_ERROR_WAIT_TIMEOUT)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue