I sometimes need to display a GUI window just once in the script and have noticed that the command Gui, Destroy does not clear the values used in the GUI window. I'm not sure if there is a reason for it but I think destroy should mean to dispose everything whatever it contains.
We can see the variable TextHwnd still contains the value by running the code below and via the "Variable and their contents" window, the variable Text is still alive.
Gui, Add, Text, vText hwndTextHwnd, Hello World! Gui, Destroy msgbox % TextHwnd returnSo my suggestion is to delete variables used in a GUI window after Gui, Destroy is used, or add an option Gui, +DeleteVarsWithDestroy or something similar.
What about it.