On Thu, 29 Oct 2009 15:00:53 +0200 Graeme Geldenhuys <graemeg.li...@gmail.com> wrote:
> Hi, > > Do I create a memory leak if I cast a PChar it a AnsiString. Then > append text to the AnsiString and then cast it back to the original > PChar? > > eg: > var > Text: Pchar; <-- global var containing text. > > procedure AppendText(const AText: string); > var > s: string; > begin > s := Text + AText; > Text := PChar(s); Text:=strnew(PChar(s)); > end; Mattias _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal