I am writing a multithreaded program that receives connections from a socket within a thread and then creates another "child" thread to handle futher communications on that socket. Then the "father" thread goes back to waiting for more connection attempts. When the "child" thread finishes its operations I close the socket handle, delete dynamic memory, and do an ExitThread. The problem is that everytime this happens the memory is not released. Shouldn't all memory be released after the "child" thread is done. Also, note that up to 60 "child" threads may be created and terminated at the same time so the memory is creeping up very quickly? Does ExitThread unload the threads stack memory automatically?
Please, any help would be appreciated.