[Lazarus] Gtk2 missed try-finally

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Jul 25 12:31:06 CEST 2017


On Tue, 25 Jul 2017 13:16:50 +0300
Alexey via Lazarus <lazarus at lists.lazarus-ide.org> wrote:

> gtk2proc.inc, procedure DrawImageListIconOnWidget: it allocates Bitmap + 
> DC. Pls add try-finally for Bitmap; and (not sure) try-finally for DC:

How did you manage to create a mem leak there?

 
>      finally
>        ReleaseDC(HDC({%H-}PtrUInt(DestWidget)),DestDC);
>      end;
>    finally
>      Bitmap.Free;
>    end;


Mattias
 


More information about the Lazarus mailing list