David, I don't see how you are not getting memory leaks by doing a move before making sure that the destination buffer has the memory allocated. You see, in Delphi and FPC, move d/n actually move the memory... It just copies it.
You were warned :-) On Sat, Apr 24, 2010 at 3:01 PM, David Emerson <dle...@angelbase.com> wrote: > cobines wrote: >> David Emerson wrote: >> > move (src.f_data, self.f_data, length(self.f_data) * sizeof(byte)); >> >> I think it should be: >> >> SetLength(self.f_data, length(src.f_data)); >> move (src.f_data[0], self.f_data[0], length(self.f_data) * sizeof(byte)); > > Well, the setlength is not necessary, and very nearly prevented me from > noticing > the real solution here, f_data[0] -- thanks very much, it is working now. > (I have this feeling like I have asked this question before. d'oh.) > > ~David. > > _______________________________________________ > fpc-pascal maillist - fpc-pas...@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal