Don't crash if we fail to BeginBufferedPaint (#11674)
Fixes MSFT:34673647, at least I'm pretty sure. That's only ever hit a few times externally, and internally it's hitting a lot on 1.9.1942 builds, which doesn't really make any sense.
This commit is contained in:
parent
55dbda02a5
commit
a74c37bbcd
|
@ -843,7 +843,11 @@ void NonClientIslandWindow::_UpdateFrameMargins() const noexcept
|
||||||
HPAINTBUFFER buf = BeginBufferedPaint(hdc.get(), &rcRest, BPBF_TOPDOWNDIB, ¶ms, &opaqueDc);
|
HPAINTBUFFER buf = BeginBufferedPaint(hdc.get(), &rcRest, BPBF_TOPDOWNDIB, ¶ms, &opaqueDc);
|
||||||
if (!buf || !opaqueDc)
|
if (!buf || !opaqueDc)
|
||||||
{
|
{
|
||||||
winrt::throw_last_error();
|
// MSFT:34673647 - BeginBufferedPaint can fail, but it probably
|
||||||
|
// shouldn't bring the whole Terminal down with it. So don't
|
||||||
|
// throw_last_error here.
|
||||||
|
LOG_LAST_ERROR();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
::FillRect(opaqueDc, &rcRest, _backgroundBrush.get());
|
::FillRect(opaqueDc, &rcRest, _backgroundBrush.get());
|
||||||
|
|
Loading…
Reference in a new issue