Kaydet (Commit) ceb6b00e authored tarafından Caolán McNamara's avatar Caolán McNamara

silence DrMemory warning about Selected font handle deleted

This might actually matter in practice given

https://stackoverflow.com/questions/27422871/does-deletedc-automatically-unselect-objects

"DCs get a default 1x1x1 bitmap when they're created. This will leak if you don't put it back."

Change-Id: Ib2d361995621ad429277ff52cb8c9fdfc0009953
Reviewed-on: https://gerrit.libreoffice.org/38875Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 2e0b0d47
......@@ -53,13 +53,14 @@ static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pU
unsigned char* pBuffer = nullptr;
HFONT hFont = static_cast<HFONT>(pUserData);
HDC hDC = GetDC(nullptr);
SelectObject(hDC, hFont);
HGDIOBJ hOrigFont = SelectObject(hDC, hFont);
nLength = ::GetFontData(hDC, OSL_NETDWORD(nTableTag), 0, nullptr, 0);
if (nLength > 0 && nLength != GDI_ERROR)
{
pBuffer = new unsigned char[nLength];
::GetFontData(hDC, OSL_NETDWORD(nTableTag), 0, pBuffer, nLength);
}
SelectObject(hDC, hOrigFont);
ReleaseDC(nullptr, hDC);
#elif defined(MACOSX) || defined(IOS)
unsigned char* pBuffer = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment