mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[0.4.11][DESK] Fix GetDC/ReleaseDC error management
Fix missing ReleaseDC related to the spectrum (color depth)
We leaked one device context for each bpp change within the
desk.cpl-session, which gave the following logging when closing desk.cpl:
(win32ss/user/ntuser/windc.c:749) err: [00060138] GetDC() without ReleaseDC()!
1 time for each leak.
Partial backport of (#2707)
Fix picked from 0.4.15-dev-2867-g d635ce0cc0
This commit is contained in:
parent
14252f8a1e
commit
fac0366e93
1 changed files with 4 additions and 0 deletions
|
@ -472,8 +472,12 @@ OnBPPChanged(IN HWND hwndDlg, IN PSETTINGS_DATA pData)
|
|||
/* Show a new spectrum bitmap */
|
||||
hSpectrumControl = GetDlgItem(hwndDlg, IDC_SETTINGS_SPECTRUM);
|
||||
hSpectrumDC = GetDC(hSpectrumControl);
|
||||
if (hSpectrumDC == NULL)
|
||||
return;
|
||||
|
||||
GetClientRect(hSpectrumControl, &client);
|
||||
ShowColorSpectrum(hSpectrumDC, &client, dmNewBitsPerPel, pData);
|
||||
ReleaseDC(hSpectrumControl, hSpectrumDC);
|
||||
|
||||
/* Find if new parameters are valid */
|
||||
Current = pData->CurrentDisplayDevice->CurrentSettings;
|
||||
|
|
Loading…
Reference in a new issue