Modify ↓
Opened 6 days ago
Last modified 4 days ago
#4028 new Bug
Potential for a memory leak in _GDIPlus_BitmapCreateFromMemory
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Milestone: | Component: | AutoIt | |
Version: | 3.3.16.1 | Severity: | None |
Keywords: | Cc: |
Description
to fix:
in GDIPlus.au3,
in function _GDIPlus_BitmapCreateFromMemory,
replace this:
Local Const $hBitmap = _GDIPlus_BitmapCreateFromStream($hStream) ;creates a Bitmap object based on an IStream COM interface If @error Then Return SetError(3, 0, 0) DllCall("oleaut32.dll", "long", "DispCallFunc", "ptr", $hStream, "ulong_ptr", 8 * (1 + @AutoItX64), "uint", 4, "ushort", 23, "uint", 0, "ptr", 0, "ptr", 0, "str", "") ;release memory from $hStream to avoid memory leak
with this:
Local Const $hBitmap = _GDIPlus_BitmapCreateFromStream($hStream) ;creates a Bitmap object based on an IStream COM interface Local $error = @error DllCall("oleaut32.dll", "long", "DispCallFunc", "ptr", $hStream, "ulong_ptr", 2 * (@AutoItX64 ? 8 : 4), "uint", 4, "ushort", 23, "uint", 0, "ptr", 0, "ptr", 0, "str", "") ;release memory from $hStream to avoid memory leak (2 is the offset of the Release method of IUnknown in its vtable) If $error Then Return SetError(3, 0, 0)
Attachments (0)
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
Note: See
TracTickets for help on using
tickets.
Potential for a memory leak in _GDIPlus_Bitmap Create From Memory, you can choose [Biwintechnology memory modules]https://biwintechnology.com/.