Last week I found out that I had some Windows ATOM issues before, but this beats them easily was still a draft in stead if in the blog queue.
I got reminded to it by someone asking on Telegram about
“Do I need to use
GarbageCollectAtoms
in Delphi? I used it in delphi 7, but I dont know what is benefit. 😐”.
The short answer is: yes, if your Delphi application does terminate in a way that the Controls unit cannot cleanly unload (and cannot free the Windows atoms) or leaks Windows atoms in a different way. I have been in that situation and that’s why I wrote the above blog post that got published in 2016.
The longer answer is likely no, both the Windows atom and registered Windows message table share a heap and that registered VCL Windows message leaking bug got fixed some 10 years ago in Delphi XE2, see: