Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #508 from adobe/abose/WinHiDpiHDCLeak
Browse files Browse the repository at this point in the history
Abose/win hi dpi hdc leak
  • Loading branch information
nethip committed Mar 12, 2015
2 parents 298b68e + c7a4b37 commit 67b37d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions appshell/cef_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,5 +359,6 @@ UINT cef_window::GetDPIScalingX() const
float lpx = dc ? GetDeviceCaps(dc,LOGPIXELSX):DEFAULT_WINDOWS_DPI ;
//scale factor as it would look in a default(96dpi) screen. the default will be always 96 logical DPI when scaling is applied in windows.
//see. https://msdn.microsoft.com/en-us/library/ms701681(v=vs.85).aspx
ReleaseDC(dc);
return (lpx/DEFAULT_WINDOWS_DPI)*100;
}
2 changes: 1 addition & 1 deletion appshell/cef_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class cef_window
HDC GetDC() const
{ return ::GetDC(mWnd); }

int ReleaseDC(HDC dc)
int ReleaseDC(HDC dc) const
{ return ::ReleaseDC(mWnd, dc); }

BOOL SetWindowPos(cef_window* insertAfter, int x, int y, int cx, int cy, UINT uFlags)
Expand Down

0 comments on commit 67b37d7

Please sign in to comment.