Fix HDC leak in CreateFont

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6275 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2012-11-09 23:17:33 +00:00
parent ae879b7c0a
commit bd2afdb1f3

View file

@ -832,7 +832,9 @@ static int NSISCALL ExecuteEntry(entry *entry_)
case EW_CREATEFONT:
{
static LOGFONT f;
f.lfHeight=-MulDiv(GetIntFromParm(2),GetDeviceCaps(GetDC(g_hwnd),LOGPIXELSY),72);
const HDC hdc=GetDC(g_hwnd);
f.lfHeight=-MulDiv(GetIntFromParm(2),GetDeviceCaps(hdc,LOGPIXELSY),72);
ReleaseDC(g_hwnd,hdc);
f.lfWeight=GetIntFromParm(3);
f.lfItalic=parm4&1;
f.lfUnderline=parm4&2;