On Thu, 19 Jan 2012 18:52:26 +0100 Bart <bartjun...@gmail.com> wrote:
> Hi, > > What is the correct way to use TRawImage.PerformEffect? > Simply doing: > Image1.Picture.Bitmap.RawImage.PerformEffect(someeffect) > will lead to memory loss, due to a getmem() call in PerformEffect. > > Without looking at the context I tried freeing the memory allocated by > getmem by using freemem inside the PerformEffect method. > (You can see this "fix" in the attached patch in > http://bugs.freepascal.org/view.php?id=21068 ) > > Now Image1.Picture.Bitmap.RawImage.PerformEffect(someeffect) doesn't > leak memory anymore, but after rebuilding Lazarus the IDE crashes (at > least on Win7). > Undoing my "fix" and rebuilding Lazarus with -gh shows that Lazarus > does not leak memory, even after numerous calls to > TRawImage.PerformEffect (made by TImageList). > > So either this simple > Image1.Picture.Bitmap.RawImage.PerformEffect(someeffect) is plain > wrong usage, or TImageList does something special to avoid this memory > leak? (I looked at the sources of TImageList but I'm obviously not > clever enough to see the solution.) > > Can someone shed some light on this? TCustomImageList frees the memory itself. I added an option, so you can choose to free the memory. Mattias -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus