No, you have nothing to worry about. A handler returned, for example, by OpenProcess, ShellExecuteEx (), or CreateProcess, keeps the process object active. How you can call GetExitCodeProcess () to retrieve the exit code after the process terminates.
An object is not freed until the last handle on it is closed. Unlike the previous tips provided in this thread, it is very important that you call CloseHandle () or you have a leak.
source
share