Raphael fenix@club-internet.fr writes:
Hi,
cf http://bugs.winehq.org/show_bug.cgi?id=872
Seems he have created events (hTemps) leaks no ?
I'm not sure why that code uses global handles at all, since they get duplicated in the target process anyway; it seems to me you could simply get rid of the ConvertToGlobalHandle calls. If that doesn't work the code needs to be fixed, global handles are a Win9x abomination that should never be used.
On Tuesday 08 March 2005 17:02, Alexandre Julliard wrote:
Raphael fenix@club-internet.fr writes:
Hi,
cf http://bugs.winehq.org/show_bug.cgi?id=872
Seems he have created events (hTemps) leaks no ?
I'm not sure why that code uses global handles at all, since they get duplicated in the target process anyway; it seems to me you could simply get rid of the ConvertToGlobalHandle calls. If that doesn't work the code needs to be fixed, global handles are a Win9x abomination that should never be used.
Ok, Better patch
Regards, Raphael
Raphael wrote:
*lphStart = CreateEventW( &s_attrib, TRUE, FALSE, NULL );
*lphDeath = CreateEventW( &s_attrib, TRUE, FALSE, NULL );
*lphRead = CreateEventW( &s_attrib, TRUE, FALSE, NULL );
if( ( !DuplicateHandle( GetCurrentProcess(), *lphStart, hDestProcess, &hAppStart,
@@ -1185,6 +1181,13 @@ ) { /* FIXME: Handle leak... */
- if (INVALID_HANDLE_VALUE != *lphStart) { CloseHandle(*lphStart); *lphStart = INVALID_HANDLE_VALUE; }
- if (INVALID_HANDLE_VALUE != *lphDeath) { CloseHandle(*lphDeath); *lphDeath = INVALID_HANDLE_VALUE; }
- if (INVALID_HANDLE_VALUE != *lphRead) { CloseHandle(*lphRead); *lphRead = INVALID_HANDLE_VALUE; }
- if (INVALID_HANDLE_VALUE != hAppStart) CloseHandle(hAppStart);
- if (INVALID_HANDLE_VALUE != hAppDeath) CloseHandle(hAppDeath);
- if (INVALID_HANDLE_VALUE != hAppRead) CloseHandle(hAppRead);
You can't close handles from another process.
ERR( "Unable to dup handles\n" ); return FALSE;
}
Rob