[SNDREC32]

do not delete objects which are still selected into a DC

svn path=/trunk/; revision=67177
This commit is contained in:
Christoph von Wittich 2015-04-12 16:29:36 +00:00
parent d0ab5ca8f8
commit fe19391da7

View file

@ -352,6 +352,7 @@ WndProc_wave(HWND hWnd,
PAINTSTRUCT ps;
HDC hdc;
HPEN pen;
HPEN oldpen;
unsigned int max_h = (cli.bottom / 2);
unsigned int samples;
@ -366,7 +367,7 @@ WndProc_wave(HWND hWnd,
/* Initialize hdc objects */
hdc = BeginPaint(hWnd, &ps);
pen = (HPEN)CreatePen(PS_SOLID, 1, WAVEBAR_COLOR);
SelectObject(hdc, (HBRUSH)pen);
oldpen = (HPEN) SelectObject(hdc, (HBRUSH)pen);
if (AUD_OUT->current_status() == snd::WAVEOUT_PLAYING)
{
samples = AUD_OUT->tot_samples_buf();
@ -412,6 +413,7 @@ WndProc_wave(HWND hWnd,
LineTo(hdc, WAVEBAR_CX, cli.bottom / 2);
}
SelectObject(hdc, oldpen);
DeleteObject( pen );
EndPaint( hWnd, &ps );
break;
@ -437,6 +439,7 @@ WndProc(HWND hWnd,
PAINTSTRUCT ps;
HDC hdc;
HFONT font;
HFONT oldfont;
long long slid_samp = 0;
/* Checking for global pointers to buffer and io audio devices */
@ -774,7 +777,7 @@ WndProc(HWND hWnd,
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
font = CreateFontIndirect(&s_info.lfMenuFont);
SelectObject(hdc, font);
oldfont = (HFONT) SelectObject(hdc, font);
SetBkMode(hdc, TRANSPARENT);
if (AUD_IN->current_status() == snd::WAVEIN_RECORDING)
@ -877,6 +880,7 @@ WndProc(HWND hWnd,
_tcslen(str_tmp),
0);
SelectObject(hdc, oldfont);
DeleteObject(font);
EndPaint(hWnd, &ps);
break;