Skip to content

Commit

Permalink
Fixed two handle leaks, found by using Deleaker (https://www.deleaker…
Browse files Browse the repository at this point in the history
  • Loading branch information
janwilmans committed Jul 22, 2019
1 parent be0e5f9 commit a2357d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DebugView++/LogView.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class CMyHeaderCtrl : public CWindowImpl<CMyHeaderCtrl, CHeaderCtrl>
// on windows 10 listview headers are missing depth, we manually draw them to compensate
void Windows10Workaround()
{
CDCHandle dc(GetDC());
CDC dc(GetDC());
RECT rect;
dc.GetClipBox(&rect);

Expand Down
6 changes: 4 additions & 2 deletions DebugView++/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,12 +623,14 @@ const wchar_t* RegistryPath = L"Software\\Cobalt Fusion\\DebugView++";

int CMainFrame::LogFontSizeFromPointSize(int fontSize)
{
return -MulDiv(fontSize, GetDeviceCaps(GetDC(), LOGPIXELSY), 72);
CDC dc(GetDC());
return -MulDiv(fontSize, GetDeviceCaps(dc, LOGPIXELSY), 72);
}

int CMainFrame::LogFontSizeToPointSize(int logFontSize)
{
return -MulDiv(logFontSize, 72, GetDeviceCaps(GetDC(), LOGPIXELSY));
CDC dc(GetDC());
return -MulDiv(logFontSize, 72, GetDeviceCaps(dc, LOGPIXELSY));
}

bool CMainFrame::LoadSettings()
Expand Down

0 comments on commit a2357d2

Please sign in to comment.