﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
2146	AutoIt passes invalid handle to CloseHandle during process shutdown	jonathan.boeing@…	Valik	"Autoit crashes frequently when run on the checked build of Windows.  The crash occurs when the process is shutting down.  Investigation showed that the crash is due to an unhandled exception caused by passing an invalid handle to CloseHandle().

The MSDN docs for CloseHandle() state that it can raise an exception if an invalid handle is passed in.

Investigation showed that AutoIt appears to be passing an uninitialized value to CloseHandle().  If the value happens to be zero, the process doesn't crash.  If the value is non-zero, the process crashes.

The exception was also reproduced on the free build of Windows when attaching a debugger to the process.

How to reproduce:
1. Run AutoIt either on the checked build of Windows or with a debugger attached
2. Run it from a command prompt without specifying a script (a script can be specified, but it is unnecessary to reproduce the exception).
3. Hit 'cancel' on the file dialog when it opens

The exception seems to be dependent on the process environment.  Running the executable from different directories or with different command lines can make it either occur or not occur.

This was seen with both version 3.3.8.0 and 3.3.9.1"	Bug	closed	3.3.9.2	AutoIt	3.3.8.0	None	Fixed		
