﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1040	_ScreenCapture_Capture(): GDI object leak with cursor capture	rover	Jpm	"The returned bitmap handles from _WinAPI_GetIconInfo() are not deleted.
(only $aIcon[4] bitmask has a valid handle when used with cursor)

modified _ScreenCapture_Capture() with added error handling in attached file

Environment = 3.3.0.0 under  WIN_XP/Service Pack 2 X86

{{{
#include <ScreenCapture.au3>
Global $hBitmap, $hProcess, $aGDIObjs

$hProcess = _WinAPI_GetCurrentProcess()
If @error Then $hProcess = 0xFFFFFFFF

While 1
	Sleep(50)
	$hBitmap = _ScreenCapture_Capture("""", 0, 0, 400, 300, True)
	_WinAPI_DeleteObject($hBitmap)
	$aGDIObjs = DllCall(""user32.dll"", ""int"", ""GetGuiResources"", ""hwnd"", $hProcess, ""int"", 0)
	ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : GDI Objects = ' & $aGDIObjs[0] & @CRLF)
	If $aGDIObjs[0] > 40 Then Exit
WEnd
}}}"	Bug	closed	3.3.7.0	Standard UDFs	3.3.0.0	None	Fixed	_ScreenCapture_Capture	
