diff options
-rw-r--r-- | pjmedia/src/pjmedia-audiodev/wmme_dev.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) { |