Article ID: 815235 - View products that this article applies to.
This article has been archived. It is offered "as is" and will no longer be updated.
In a multithreaded application, if a DLL's DllMain makes a call to _set_se_translator, you may experience a memory leak in the CRT.
This problem occurs if you used the _beginthreadex API to create the thread because the initialization order in the CRT causes the per thread data (PTD) structure for the thread to be allocated two times.
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.
Note You must have a Visual Studio license agreement to obtain this hotfix.
To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
Date Time Version Size File name ------------------------------------------------------ 22-Feb-2003 04:42 3,218,510 Libcmtd.lib 22-Feb-2003 04:46 6.0.9748.0 434,252 Msvcrtd.dll 22-Feb-2003 04:33 934,378 Libcmt.lib 22-Feb-2003 05:45 6.0.9748.0 278,581 Msvcrt.dll 22-Feb-2003 03:42 6,615 Thread.c 22-Feb-2003 03:42 8,554 Threadex.c
You can avoid this problem by calling _set_se_translator at the beginning of your thread procedure instead of in DllMain. It is not a good idea to call CRT functions such as _set_se_translator in DllMain.
You can also work around the problem by using CreateThread instead of _beginthreadex to start your threads.
Article ID: 815235 - Last Review: February 27, 2014 - Revision: 1.4
Contact us for more help
Connect with Answer Desk for expert help.