Skip to content

Commit

Permalink
Merge pull request zhongyang219#1565 from BombaxCeiba/fix_end_draw_no…
Browse files Browse the repository at this point in the history
…t_invoke

fix: 再次修复了不启用插件时D2D渲染出错的问题
  • Loading branch information
zhongyang219 authored Mar 20, 2023
2 parents 4e7bb58 + 0a9eb6b commit b4ecf1c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions TrafficMonitor/TaskBarDlgDrawCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1699,11 +1699,11 @@ CTaskBarDlgDrawCommon::~CTaskBarDlgDrawCommon()
&p_gdi_interop_bitmap),
TRAFFICMONITOR_ERROR_STR("Create ID2D1Bitmap from IDXGISurface1 failed."));
m_p_device_context->DrawBitmap(p_gdi_interop_bitmap.Get());

ThrowIfFailed<CD2D1Exception>(
m_p_device_context->EndDraw(),
TRAFFICMONITOR_ERROR_STR("Call ID2D1RenderTarget::EndDraw() failed."));
}
// ! 注意:保证正常时EndDraw在不起用插件时仍然可以被调用,否则会导致D2D Begin/End调用不匹配,已经是第二次出错了。
ThrowIfFailed<CD2D1Exception>(
m_p_device_context->EndDraw(),
TRAFFICMONITOR_ERROR_STR("Call ID2D1RenderTarget::EndDraw() failed."));
}
catch (CHResultException& ex)
{
Expand Down

0 comments on commit b4ecf1c

Please sign in to comment.