CreateThread returns a HANDLE object that need to be closed by CloseHandle
The documentation states that The thread object remains in the system until the thread has terminated and all handles to it have been closed through a call to CloseHandle.
My question is what happens if the return variable is not used. It equals with not closing returned handle and because of this with a handle leak? It’s that correct ?
It equals with not closing returned handle and because of this with a handle leak? It’s that correct ?
Yes, You will be leaking Operating system resources, this is analogous to leaking memory when you have a memory leak.
Reference:
MSDN Documentation: