Could the changes to __Delete be explained?

Discuss the future of the AutoHotkey language
iseahound
Posts: 1444
Joined: 13 Aug 2016, 21:04
Contact:

Could the changes to __Delete be explained?

Post by iseahound » 04 Feb 2023, 23:09

In v2.0-beta.13:
https://www.autohotkey.com/boards/viewtopic.php?f=24&t=95688#p488852 wrote: Fixed issues when x.__Delete() accesses x during assignment/free.
During execution of __Delete, x now contains its new value, not "".
Any value assigned during __Delete is now retained rather than being overwritten (and possibly leaked) by the original assignment.

...

Changed object-release-on-exit to make variables unset, not merely blank.
Changed object-release-on-exit to avoid releasing constants.
These cannot be safely released as load-time optimizations replace non-dynamic references with uncounted object pointers within the code.
Makes little sense for the value of a constant to change.
Fixes dynamic references to constants during exit.
Fixes potential double-deletion of objects during exit.
Fixes potential re-initialization of classes referenced during exit.
Improves the odds that __Delete will work as intended (if called).
Such objects could only ever be deleted during exit, so OnExit provides a (more) suitable alternative.
From a user standpoint, reloading the application, deleting objects, and rightclicking the tray icon to ExitApp no longer throws errors.

Specifically, to what degree can the new __Delete order be relied upon? and to what extent? What is the new delete order? Also what is a constant within the context of AutoHotkey?

Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Could the changes to __Delete be explained?

Post by Helgef » 05 Feb 2023, 06:36

There might be some information in :arrow: #304, regarding the first points.
From a user standpoint, reloading the application, deleting objects, and rightclicking the tray icon to ExitApp no longer throws errors.
?
Specifically, to what degree can the new __Delete order be relied upon? and to what extent? What is the new delete order?
What new order?
Also what is a constant within the context of AutoHotkey?
At least classes (eg, x in class x {...} ) and named functions (eg, f in f() {...]) are constants.

Cheers.

safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Re: Could the changes to __Delete be explained?

Post by safetycar » 07 Feb 2023, 10:20

Regarding __Delete there was a post here that might interest you: viewtopic.php?f=13&t=112007

Post Reply

Return to “AutoHotkey Development”