Skip to content

Commit

Permalink
Bug 1330755 - Properly release the window device context. r=jimm
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: 7Y3p4g3yI3s

--HG--
extra : rebase_source : 111817e743836644fb1077c9b961cfe99a62980f
  • Loading branch information
staktrace committed Jan 12, 2017
1 parent 58d4348 commit a147e85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion widget/windows/nsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,10 @@ nsWindow::CreateScrollSnapshot()
return GetFallbackScrollSnapshot(clip);
}

nsAutoHDC windowDC(::GetDC(mWnd));
HDC windowDC = ::GetDC(mWnd);
auto releaseDC = MakeScopeExit([&] {
::ReleaseDC(mWnd, windowDC);
});
if (!windowDC) {
return GetFallbackScrollSnapshot(clip);
}
Expand Down

0 comments on commit a147e85

Please sign in to comment.