stock objects don't need to be deleted

svn path=/trunk/; revision=29969
This commit is contained in:
Thomas Bluemel 2007-10-30 01:51:23 +00:00
parent b9ef3cb742
commit 935014319a

View file

@ -308,7 +308,7 @@ void Graph_DrawMemUsageGraph(HDC hDC, HWND hWnd)
RECT rcText; RECT rcText;
COLORREF crPrevForeground; COLORREF crPrevForeground;
TCHAR Text[260]; TCHAR Text[260];
HFONT hFont, hOldFont; HFONT hOldFont;
ULONGLONG CommitChargeTotal; ULONGLONG CommitChargeTotal;
ULONGLONG CommitChargeLimit; ULONGLONG CommitChargeLimit;
int nBars; int nBars;
@ -344,8 +344,7 @@ void Graph_DrawMemUsageGraph(HDC hDC, HWND hWnd)
rcText = rcClient; rcText = rcClient;
InflateRect(&rcText, -2, -2); InflateRect(&rcText, -2, -2);
crPrevForeground = SetTextColor(hDC, RGB(0, 255, 0)); crPrevForeground = SetTextColor(hDC, RGB(0, 255, 0));
hFont = GetStockObject(DEFAULT_GUI_FONT); hOldFont = SelectObject(hDC, GetStockObject(DEFAULT_GUI_FONT));
hOldFont = SelectObject(hDC, hFont);
DrawText(hDC, Text, -1, &rcText, DT_BOTTOM | DT_CENTER | DT_NOPREFIX | DT_SINGLELINE); DrawText(hDC, Text, -1, &rcText, DT_BOTTOM | DT_CENTER | DT_NOPREFIX | DT_SINGLELINE);
SelectObject(hDC, hOldFont); SelectObject(hDC, hOldFont);
SetTextColor(hDC, crPrevForeground); SetTextColor(hDC, crPrevForeground);
@ -406,7 +405,6 @@ void Graph_DrawMemUsageGraph(HDC hDC, HWND hWnd)
} }
SelectObject(hDC, hOldFont); SelectObject(hDC, hOldFont);
DeleteObject(hFont);
} }
void Graph_DrawMemUsageHistoryGraph(HDC hDC, HWND hWnd) void Graph_DrawMemUsageHistoryGraph(HDC hDC, HWND hWnd)