Ticket #84 (closed defect: fixed)
fix memory leak in wwme
| Reported by: | gordon_gidluck | Owned by: | gordon_gidluck |
|---|---|---|---|
| Priority: | major | Milestone: | V19-RC1 |
| Component: | host-api-wmme | Version: | 1.0 |
| Keywords: | Cc: |
Description
submitted by bodo.maass@… on 08/22/2008
SUMMARY
All C Run-time functions except the signal() function work correctly when used in threads that are created by the CreateThread?() function. However, depending on what CRT functions are called, there may be a small memory leak when threads are terminated. Calling strlen(), for example, does not trigger the allocation of the CRT thread data-block, and calling malloc(), fopen(), _open(), strtok(), ctime(), or localtime() causes allocation of a CRT per-thread data-block, which may cause a memory leak.
details are here: http://support.microsoft.com/default.aspx/kb/104641
This defect also applies to wdmks and wasapi portAudio api's.
The solution is to use _beginthreadex() instead of CreateThread?() and also _endthreadex() instead of ExitThread?() .
