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
d635ce0cc0336a9b77d243ddce946876f48ec4f6
/* 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;