mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
patch applied from Christoph at ApiViewer.de: fix font handle leak
svn path=/trunk/; revision=18174
This commit is contained in:
parent
2357be7820
commit
c9d6d045e6
1 changed files with 6 additions and 1 deletions
|
@ -2247,9 +2247,11 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
|
||||||
|
|
||||||
if (ChooseFont(&chFont)) {
|
if (ChooseFont(&chFont)) {
|
||||||
HWND childWnd;
|
HWND childWnd;
|
||||||
|
HFONT hFontOld;
|
||||||
|
|
||||||
|
DeleteObject(Globals.hfont);
|
||||||
Globals.hfont = CreateFontIndirect(&lFont);
|
Globals.hfont = CreateFontIndirect(&lFont);
|
||||||
SelectFont(hdc, Globals.hfont);
|
hFontOld = SelectFont(hdc, Globals.hfont);
|
||||||
GetTextExtentPoint32(hdc, sSpace, 1, &Globals.spaceSize);
|
GetTextExtentPoint32(hdc, sSpace, 1, &Globals.spaceSize);
|
||||||
|
|
||||||
/* change font in all open child windows */
|
/* change font in all open child windows */
|
||||||
|
@ -2262,6 +2264,8 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
|
||||||
InvalidateRect(child->left.hwnd, NULL, TRUE);
|
InvalidateRect(child->left.hwnd, NULL, TRUE);
|
||||||
InvalidateRect(child->right.hwnd, NULL, TRUE);
|
InvalidateRect(child->right.hwnd, NULL, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SelectFont(hdc, hFontOld);
|
||||||
}
|
}
|
||||||
else if (CommDlgExtendedError()) {
|
else if (CommDlgExtendedError()) {
|
||||||
LoadString(Globals.hInstance, IDS_FONT_SEL_DLG_NAME, dlg_name, BUFFER_LEN);
|
LoadString(Globals.hInstance, IDS_FONT_SEL_DLG_NAME, dlg_name, BUFFER_LEN);
|
||||||
|
@ -4774,6 +4778,7 @@ static void ExitInstance(void)
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DeleteObject(Globals.hfont);
|
||||||
ImageList_Destroy(Globals.himl);
|
ImageList_Destroy(Globals.himl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue