<div dir="ltr"><div class="h5"><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
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...<br>
<br></div></blockquote><div>This worked in my TTree class (destructor):<br><br> if PTypeInfo(TypeInfo(Data))^.Kind = tkObject then TObject(Data).Free; <br><br></div><div>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?<br>
<br></div></div></div></div>