Clarification please regarding OnFreeNode handling for strings etc #1219
Labels
Repro Steps Missing
A smple project is needed to reprodcue and analyze the issue. See our guidelines for opening issues!
The OnFreeNode event Help doc mentions: "You should however finalize the data in such a case if it contains references to external memory objects (e.g. variants, strings, interfaces)."
Could we get a more explicit description or example of how to handle this? Does it mean calling Finalize on each individual dynamically-allocated field? Or is it possible to call a single function (possibly Finalize), passing the entire data record?
I am not 100% sure from the Embarcadero doc how to do this. The example page "System InitializeFinalize (Delphi) shows:
For the TVirtualStringTree node data, I think we skip GetMem and Initialize, but in OnFreeNode we have to:
... and I think the FreeMem is unnecessary and should not be called.
Is all that right?
Thanks.
The text was updated successfully, but these errors were encountered: