Hi,
Suppose you are creating a simple multithreaded application in MS visual C/C++ (ver.6), Now please consider the following cases:
CASE 1:
------------
A Non-MFC application, where the Thread Function calls one or more C Run-time functions.
According to documentation we should use C Run-time function _beginthread , instead of directly calling WIN API Thread functions, to prevent memory leak. Fine.
CASE 2:
------------
The same application now MFC. Thread Function calls one or more C Run-time functions, so don’t use WIN API directly. Documentation also says don’t use _beginthread on MFC, use AfxBeginThread.
Hmm! Isn’t AfxBeginThread is just a wrapper for the CreateThread API function. Does it take care about those memory leak ( calling C Run-times in Thread function, remember) ?
Oh! I’m surely missing something here. What do you guys think?