Modify ↓
Opened on Sep 25, 2009 at 8:09:33 PM
Closed on Oct 9, 2009 at 6:26:18 PM
Last modified on Feb 9, 2012 at 3:35:53 PM
#1196 closed Bug (Fixed)
_GDIPlus_BitmapUnlockBits - Memory is not released
| Reported by: | eukalyptus | Owned by: | |
|---|---|---|---|
| Milestone: | 3.3.1.0 | Component: | AutoIt |
| Version: | 3.3.0.0 | Severity: | None |
| Keywords: | _GDIPlus_BitmapUnlockBits UnlockBits Memory GdiPlus GDI+ | Cc: |
Description
_GDIPlus_BitmapUnlockBits dose not release the allocated memory.
If you change the DllCall-type "int*" to "ptr" it works fine - see example:
#include <ScreenCapture.au3>
Global $hScreen, $hBitmap, $aMem, $tData
_GDIPlus_Startup()
$hScreen=_ScreenCapture_Capture("", 0, 0, -1, -1, False)
$hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hScreen)
For $i=1 To 50
$tData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, _GDIPlus_ImageGetWidth($hBitmap), _GDIPlus_ImageGetHeight($hBitmap), $GDIP_ILMREAD, $GDIP_PXF24RGB)
_GDIPlus_BitmapUnlockBits($hBitmap, $tData)
Sleep(50)
$aMem = MemGetStats()
ConsoleWrite("original function; step " & $i & "; mem usage: " & $aMem[0] & @LF)
Next
ConsoleWrite(@LF)
For $i=1 To 50
$tData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, _GDIPlus_ImageGetWidth($hBitmap), _GDIPlus_ImageGetHeight($hBitmap), $GDIP_ILMREAD, $GDIP_PXF24RGB)
_GDIPlus_BitmapUnlockBits_($hBitmap, $tData)
Sleep(50)
$aMem = MemGetStats()
ConsoleWrite("test function; step " & $i & "; mem usage: " & $aMem[0] & @LF)
Next
Func _GDIPlus_BitmapUnlockBits_($hBitmap, $tBitmapData)
Local $aResult
$aResult = DllCall($ghGDIPDll, "int", "GdipBitmapUnlockBits", "hwnd", $hBitmap, "ptr", DllStructGetPtr($tBitmapData)) ;Type ptr instead of int*
If @error Then Return SetError(@error, @extended, False)
Return SetError($aResult[0], 0, $aResult[0] = 0)
EndFunc ;==>_GDIPlus_BitmapUnlockBits
Attachments (1)
Change History (4)
by , on Sep 25, 2009 at 8:10:08 PM
| Attachment: | _GDIPlus_BitmapUnlockBits.au3 added |
|---|
comment:1 by , on Oct 9, 2009 at 6:26:18 PM
| Resolution: | → Fixed |
|---|---|
| Status: | new → closed |
comment:3 by , on Feb 9, 2012 at 3:35:53 PM
| Milestone: | Future Release → 3.3.1.0 |
|---|
Note:
See TracTickets
for help on using tickets.

As been fixed with the global verification of MSDN matching type for all Include files