I'd like to just create a thread, then call CloseHandle immediately and let the thread die on its own so that I don't have to do extra clean-up work in the 'original' thread (not that cleanup is hard in itself, but it means a fair amount of extra book-keeping which I'd like to avoid).
MSDN says that calling CloseHandle() on a thread doesn't terminate the thread, but it's not clear to me whether that means I'm really allowed to do this or not.
Not only is it reasonable, not doing it is a handle leak. Generally I close it immediately after creating the thread unless I'm going to need it elsewhere.
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