I’m not interested in using the handle returned from _beginthreadex(). Is it safe to call CloseHandle() on it immediately?
I believe this must be done to avoid memory leaks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you can close the handle as soon as you decide you no longer need that handle. That won’t affect thread execution. However you likely should check whether the thread has been started at all before you proceed.
The leaks you’re concerned about are not memory leaks, they are system resources leaks – usually they are much worse.