From 5492839463ed59db098169cd486ed9eb585d48e2 Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Fri, 27 Mar 2009 15:36:18 +0000 Subject: Ticket #771 (auddev-misc): Fixed handle leak in WMME, handle of thread quit event never got closed. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2557 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/src/pjmedia-audiodev/wmme_dev.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pjmedia/src/pjmedia-audiodev') diff --git a/pjmedia/src/pjmedia-audiodev/wmme_dev.c b/pjmedia/src/pjmedia-audiodev/wmme_dev.c index 720ae0c1..02448939 100644 --- a/pjmedia/src/pjmedia-audiodev/wmme_dev.c +++ b/pjmedia/src/pjmedia-audiodev/wmme_dev.c @@ -1256,6 +1256,7 @@ static pj_status_t stream_destroy(pjmedia_aud_stream *strm) stream_stop(strm); + /* Stop the stream thread */ if (stream->thread) { SetEvent(stream->thread_quit_event); @@ -1264,6 +1265,13 @@ static pj_status_t stream_destroy(pjmedia_aud_stream *strm) stream->thread = NULL; } + /* Close the thread quit event */ + if (stream->thread_quit_event) + { + CloseHandle(stream->thread_quit_event); + stream->thread_quit_event = NULL; + } + /* Unprepare the headers and close the play device */ if (stream->play_strm.hWave.Out) { -- cgit v1.2.3