PortAudio / portaudio

PortAudio is a cross-platform, open-source C language library for real-time audio input and output.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DirectSound Host API leaks the streaming thread handle

dechamps opened this issue · comments

This code:

#undef CLOSE_THREAD_HANDLE /* as per documentation we don't call CloseHandle on a thread created with _beginthreadex */

Is incorrect - the official docs suggest the opposite:

when you use _beginthreadex and _endthreadex, you must close the thread handle by calling the Win32 CloseHandle API

This means DirectSound will leak a thread handle on every stream. This can be confirmed empirically by looking at the process Win32 handle list in e.g. Process Explorer.

I already have a fix for this in #922.