Re: [fpc-pascal] Memory leak or object destruction?

2011-02-03 Thread Andreas Schneider
On Wed, 2 Feb 2011 21:09:42 -0800, Andrew Hall wrote: Interfaces support reference counting. Only COM interfaces, but they are currently the default anyway. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailma

Re: [fpc-pascal] Memory leak or object destruction?

2011-02-02 Thread Andrew Hall
Interfaces support reference counting. ISomeObject = interface TSomeObject = class(TinterfacedObject, ISomeObject) var MyObj: ISomeObject; Regards, On 02 Feb 11, at 15:22 , Bo Berglund wrote: > Will this create a memory leak or will FPC fnd by reference counting > that nothing references the

Re: [fpc-pascal] Memory leak or object destruction?

2011-02-02 Thread Michael Van Canneyt
On Thu, 3 Feb 2011, Bo Berglund wrote: I am curious as to how FPC handles the following situations: var MyObj: TsomeObject; begin MyObj := TsomeObject.Create; // do some processing MyObj := NIL; end; Will this create a memory leak or will FPC fnd by reference counting that nothing refere

[fpc-pascal] Memory leak or object destruction?

2011-02-02 Thread Bo Berglund
I am curious as to how FPC handles the following situations: var MyObj: TsomeObject; begin MyObj := TsomeObject.Create; // do some processing MyObj := NIL; end; Will this create a memory leak or will FPC fnd by reference counting that nothing references the object memory and dispose of it