Mercurial > libavcodec.hg
comparison w32thread.c @ 10044:560708e850a4 libavcodec
Fix a memleak with win32 threads: the handle returned by _beginthreadex
must be closed (this differs from _beginthread).
Patch by Shehzad Salim (shehzadsalim gmail com)
author | reimar |
---|---|
date | Wed, 12 Aug 2009 13:25:37 +0000 |
parents | a9734fe0811e |
children | 32ee88f14239 |
comparison
equal
deleted
inserted
replaced
10043:5d5562aa94df | 10044:560708e850a4 |
---|---|
67 c[i].func= NULL; | 67 c[i].func= NULL; |
68 ReleaseSemaphore(c[i].work_sem, 1, 0); | 68 ReleaseSemaphore(c[i].work_sem, 1, 0); |
69 WaitForSingleObject(c[i].thread, INFINITE); | 69 WaitForSingleObject(c[i].thread, INFINITE); |
70 if(c[i].work_sem) CloseHandle(c[i].work_sem); | 70 if(c[i].work_sem) CloseHandle(c[i].work_sem); |
71 if(c[i].done_sem) CloseHandle(c[i].done_sem); | 71 if(c[i].done_sem) CloseHandle(c[i].done_sem); |
72 if(c[i].thread) CloseHandle(c[i].thread); | |
72 } | 73 } |
73 | 74 |
74 av_freep(&s->thread_opaque); | 75 av_freep(&s->thread_opaque); |
75 } | 76 } |
76 | 77 |