Free Yourself
[Estimated Reading Time: 4 minutes] Barry Kelly recently posted an example of “smart” pointers (specifically the auto-pointer variant of a smart pointer) using generics in Delphi 2009. It was an interesting use of generics but the end result was something that has – in part at least – been possible for some time in Delphi even without generics – reliable cleanup of objects. This was something that a colleague of mine, Geza Sabo, pointed out, based on some code I’d previously shared with him to robustly manage the hourglass cursor in a GUI application.