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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With