Modify

Opened 2 years ago

Last modified 14 months 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

Change History (4)

comment:1 Changed 2 years ago by Jpm

  • Reporter changed from anonymous to AutoXenon

comment:2 Changed 2 years ago by Jpm

  • Owner set to Jpm
  • Status changed from new to assigned

comment:3 Changed 2 years ago by Jpm

Fix, I sent a proposal to Jon

comment:4 Changed 14 months ago by Jpm

  • Owner changed from Jpm to Jon

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.

Add Comment

Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.