[ros-diffs] [pschweitzer] 54829: [DPLAYX] Fix handle leak Already sent & committed upstream: http://source.winehq.org/git/wine.git/commit/2d14f89fea8fa7d7819e5c22ace94dbf41411601

pschweitzer at svn.reactos.org pschweitzer at svn.reactos.org
Tue Jan 3 20:44:42 UTC 2012


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/2d14f89fea8fa7d7819e5c22ace94dbf41411601

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_messages.c?rev=54829&r1=54828&r2=54829&view=diff
==============================================================================
--- 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;
 




More information about the Ros-diffs mailing list