Permalink
Browse files

Fix thread handle leak in StartServiceThread()

  • Loading branch information...
attilamolnar committed Dec 3, 2012
1 parent 4451fd1 commit a87c56faea8962de5951c5409d8f41647b08c875
Showing with 3 additions and 2 deletions.
  1. +3 −2 win/win32service.cpp
View
@@ -113,8 +113,9 @@ void SetServiceRunning()
/** Starts the worker thread above */
void StartServiceThread()
{
- DWORD dwd;
- CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)WorkerThread,NULL,0,&dwd);
+ HANDLE hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)WorkerThread,NULL,0,NULL);
+ if (hThread != NULL)
+ CloseHandle(hThread);
}
/** This function updates the status of the service in the SCM

0 comments on commit a87c56f

Please sign in to comment.