Modify

Opened 3 years ago

Last modified 2 years ago

#3929 assigned Bug

Memory leak when returning struct members within With...EndWith

Reported by: AutoXenon Owned by: Jon
Milestone: Component: AutoIt
Version: 3.3.16.1 Severity: None
Keywords: Cc:

Description

Original thread: ​https://www.autoitscript.com/forum/topic/209063-beware-of-abusing-undocumented-withendwith-syntax-on-dllstructs/

HotKeySet('{esc}',quit)
GUICreate("")
GUISetState()
Local $text
While 1
    $text = state()
    Sleep(10) ; don't remove this, or your RAM will blow up instantly
WEnd

Func state()
     Local Static $struct = DllStructCreate('wchar string[1024]')
     With $struct
          Return .string
     EndWith
EndFunc

Func quit()
     exit
EndFunc

Attachments (0)

Change History (4)

comment:1 by J-Paul Mesnage, 3 years ago

Reporter: changed from anonymous to AutoXenon

comment:2 by J-Paul Mesnage, 3 years ago

Owner: set to J-Paul Mesnage
Status: newassigned

comment:3 by J-Paul Mesnage, 3 years ago

Fix, I sent a proposal to Jon

comment:4 by J-Paul Mesnage, 2 years ago

Owner: changed from J-Paul Mesnage to Jon

Modify Ticket

Action
as assigned The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.