Bug 427985 - "Mozilla stops repainting in this testcase after a while" (leak fix) [p=pavlov@pavlov.net (Stuart Parmenter) r=vlad b1.9+a1.9=damons]

This commit is contained in:
reed@reedloden.com 2008-04-11 00:01:14 -07:00
Родитель 4b33c4bf3c
Коммит cc25eeb86b
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -1528,7 +1528,7 @@ public:
HDC dc = GetDC((HWND)nsnull);
HFONT hfont = font->GetHFONT();
SelectObject(dc, hfont);
HFONT oldFont = (HFONT)SelectObject(dc, hfont);
PRUnichar str[1] = { (PRUnichar)ch };
WORD glyph[1];
@ -1540,8 +1540,8 @@ public:
if (ret != GDI_ERROR && glyph[0] != 0xFFFF)
hasGlyph = PR_TRUE;
} else {
// ScriptGetCMap works better than GetGlyphIndicesW for things like bitmap/vector fonts
HRESULT rv = ScriptGetCMap(dc, font->ScriptCache(), str, 1, 0, glyph);
// ScriptGetCMap works better than GetGlyphIndicesW for things like bitmap/vector fonts
HRESULT rv = ScriptGetCMap(dc, font->ScriptCache(), str, 1, 0, glyph);
if (rv == S_OK)
hasGlyph = PR_TRUE;
}
@ -1550,6 +1550,9 @@ public:
aFontEntry->mCharacterMap.set(ch);
return PR_TRUE;
}
SelectObject(dc, oldFont);
ReleaseDC(NULL, dc);
}
return PR_FALSE;