[fpc-pascal] Class vs Object type

Santiago A. svaa at ciberpiula.net
Thu Apr 7 13:19:41 CEST 2016


El 07/04/2016 a las 13:04, Graeme Geldenhuys escribió:
> On 2016-04-07 11:58, Santiago A. wrote:
>> Moreover, if the object uses classes instances that must be freed, you
>> also must call destructor, then any advantage is over.
> Technically yes, but as a rule of thumb, I *never* use Class objects
> inside an Object object. That just seems messy.

Usually, me neither.

But I often use open arrays that can grow. Although open arrays are
pointers that use heap, they are supposed to be liberated when the
object is removed from stack, but in fpc 2.6.4 didn't properly. and
3.0.0 I have found strange behaviors and errors if I don't call a
constructor.

Nevertheless, I stick on my idea that even if objects have virtual
methods, they should be initializated properly even if you don't call
the constructor.

-- 
Saludos

Santi
svaa at ciberpiula.net




More information about the fpc-pascal mailing list