Author: pschweitzer Date: Tue Jan 3 20:44:42 2012 New Revision: 54829
URL: http://svn.reactos.org/svn/reactos?rev=54829&view=rev Log: [DPLAYX] Fix handle leak Already sent & committed upstream: http://source.winehq.org/git/wine.git/commit/2d14f89fea8fa7d7819e5c22ace94db...
Modified: trunk/reactos/dll/directx/dplayx/dplayx_messages.c
Modified: trunk/reactos/dll/directx/dplayx/dplayx_messages.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/dplayx/dplayx_m... ============================================================================== --- trunk/reactos/dll/directx/dplayx/dplayx_messages.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/dplayx/dplayx_messages.c [iso-8859-1] Tue Jan 3 20:44:42 2012 @@ -58,6 +58,7 @@ { DWORD dwMsgThreadId; LPMSGTHREADINFO lpThreadInfo; + HANDLE hThread;
lpThreadInfo = HeapAlloc( GetProcessHeap(), 0, sizeof( *lpThreadInfo ) ); if( lpThreadInfo == NULL ) @@ -83,21 +84,20 @@ lpThreadInfo->hDeath = hDeath; lpThreadInfo->hSettingRead = hConnRead;
- if( !CreateThread( NULL, /* Security attribs */ - 0, /* Stack */ - DPL_MSG_ThreadMain, /* Msg reception function */ - lpThreadInfo, /* Msg reception func parameter */ - 0, /* Flags */ - &dwMsgThreadId /* Updated with thread id */ - ) - ) + hThread = CreateThread( NULL, /* Security attribs */ + 0, /* Stack */ + DPL_MSG_ThreadMain, /* Msg reception function */ + lpThreadInfo, /* Msg reception func parameter */ + 0, /* Flags */ + &dwMsgThreadId /* Updated with thread id */ + ); + if ( hThread == NULL ) { ERR( "Unable to create msg thread\n" ); goto error; }
- /* FIXME: Should I be closing the handle to the thread or does that - terminate the thread? */ + CloseHandle(hThread);
return dwMsgThreadId;