Skip to Main Content
Mastering Delphi Programming: A Complete Reference Guide
book

Mastering Delphi Programming: A Complete Reference Guide

by Primož Gabrijelčič
November 2019
Beginner to intermediate content levelBeginner to intermediate
674 pages
15h
English
Packt Publishing
Content preview from Mastering Delphi Programming: A Complete Reference Guide

Smart pointers

Handling an object's life cycle in Delphi can be a pain. Each object that was created in code must also be destroyed; otherwise, the program will be losing memory. An attempt to solve this was the introduction of Automatic Reference Counting (ARC), which treats objects the same as interfaces. This experiment, however, is losing tract. It was recently announced that the Linux compiler will stop using ARC and that both mobile compilers (Android and iOS) will also be moved back to normal object implementation in the future.

We can simplify object life cycle management by using smart pointers. As in ARC, a smart pointer is reference counted, so the code knows when it should be destroyed and does that for us.

Delphi doesn't support ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Delphi GUI Programming with FireMonkey

Delphi GUI Programming with FireMonkey

Andrea Magni
Delphi Cookbook - Third Edition

Delphi Cookbook - Third Edition

Daniele Spinetti, Daniele Teti

Publisher Resources

ISBN: 9781838989118Other