> But it's not a good idea as you'd still need to convert Data to a TObject
> (e.g. by using a cast), but that will fail if Data is something else than a
> pointer-like type...
>
> This worked in my TTree class (destructor):

  if PTypeInfo(TypeInfo(Data))^.Kind = tkObject then TObject(Data).Free;

I don't know in what case it will fail? I tested with a TStringTree, could
you please give an example that it will fail?
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to