Recent

Author Topic: Destructors  (Read 2741 times)

Pasqualish

  • Jr. Member
  • **
  • Posts: 68
Destructors
« on: August 24, 2016, 10:46:19 am »
Is it correct to say that a destructor will not fire automatically (as they do in C++) under any conditions in Free Pascal, for either a Delphi Class or a Turbo Pascal Object?
« Last Edit: August 24, 2016, 10:52:55 am by Pasqualish »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11447
  • FPC developer.
Re: Destructors
« Reply #1 on: August 24, 2016, 11:25:30 am »
Almost for Delphi classes. The exception is when objects are used exclusively via interfaces (directly or in an olevariant), which is a bit smartpointer (ref counted) like.

TP objects afaik never auto destruct.

Pasqualish

  • Jr. Member
  • **
  • Posts: 68
Re: Destructors
« Reply #2 on: August 24, 2016, 03:35:16 pm »
Thanks.
« Last Edit: August 24, 2016, 03:37:40 pm by Pasqualish »

 

TinyPortal © 2005-2018