[Lazarus] IDE Spotter

Michael Van Canneyt michael at freepascal.org
Mon Sep 24 10:45:06 CEST 2018



On Mon, 24 Sep 2018, Juha Manninen via Lazarus wrote:

> Tested IDE Spotter on Linux / GTK2.
> Looks promising although it leaks memory.

Hm. How to fix this ? because line 179 is:

if SpotterForm=Nil then
   begin
   SpotterForm:=TSpotterForm.Create(Application);

The form is owned by the TApplication instance. If the application is freed,
the form should also be freed. That's TComponent 101...

>From your stack trace, it would seem that the form is created multiple
times, which is also strange, since it's a singleton pattern.

The form is set to do coHide on close, so it should not be freed on close.

Michael.

>
> Regards,
> Juha
>
> ---
> Heap dump by heaptrc unit
> 4466835 memory blocks allocated : 800495659/813452344
> 4464534 memory blocks freed     : 800391839/813341848
> 2301 unfreed memory blocks : 103820
> True heap size : 4259840
> True free heap : 3778816
> Should be : 3854816
> Call trace for block $00007F710BF15940 size 20
>  $00000000013CB5CC line 179 of frmspotter.pas
>  $0000000000667CE0 line 652 of include/customedit.inc
>  $0000000000667C5A line 644 of include/customedit.inc
>  $00000000005E7E74 line 1203 of include/control.inc
>  $0000000000431B9F
>  $00000000005D8DD7 line 5425 of include/wincontrol.inc
>  $0000000000667557 line 528 of include/customedit.inc
>  $000000000082BCE0 line 112 of lclmessageglue.pas
> Call trace for block $00007F712645C680 size 20
>  $00000000013CB5CC line 179 of frmspotter.pas
>  $0000000000667CE0 line 652 of include/customedit.inc
>  $0000000000667C5A line 644 of include/customedit.inc
>  $00000000005E7E74 line 1203 of include/control.inc
>  $0000000000431B9F
>  $00000000005D8DD7 line 5425 of include/wincontrol.inc
>  $0000000000667557 line 528 of include/customedit.inc
>  $000000000082BCE0 line 112 of lclmessageglue.pas
> Call trace for block $00007F712645C800 size 20
>  $00000000013CB5CC line 179 of frmspotter.pas
>  $0000000000667CE0 line 652 of include/customedit.inc
>  $0000000000667C5A line 644 of include/customedit.inc
>  $00000000005E7E74 line 1203 of include/control.inc
>  $0000000000431B9F
>  $00000000005D8DD7 line 5425 of include/wincontrol.inc
>  $0000000000667557 line 528 of include/customedit.inc
>  $000000000082BCE0 line 112 of lclmessageglue.pas
> Call trace for block $00007F712645C8C0 size 20
>  $00000000013CB5CC line 179 of frmspotter.pas
>  $0000000000667CE0 line 652 of include/customedit.inc
>  $0000000000667C5A line 644 of include/customedit.inc
>  $00000000005E7E74 line 1203 of include/control.inc
>  $0000000000431B9F
>  $00000000005D8DD7 line 5425 of include/wincontrol.inc
>  $0000000000667557 line 528 of include/customedit.inc
>  $000000000082BCE0 line 112 of lclmessageglue.pas
> Call trace for block $00007F712645B300 size 20
>  $00000000013CB5CC line 179 of frmspotter.pas
>  $0000000000667CE0 line 652 of include/customedit.inc
>  $0000000000667C5A line 644 of include/customedit.inc
>  $00000000005E7E74 line 1203 of include/control.inc
>  $0000000000431B9F
>  $00000000005D8DD7 line 5425 of include/wincontrol.inc
>  $0000000000667557 line 528 of include/customedit.inc
>  $000000000082BCE0 line 112 of lclmessageglue.pas
> Call trace for block $00007F712645CD40 size 20
>  $00000000013CB5CC line 179 of frmspotter.pas
>  $0000000000667CE0 line 652 of include/customedit.inc
>  $0000000000667C5A line 644 of include/customedit.inc
>  $00000000005E7E74 line 1203 of include/control.inc
>  $0000000000431B9F
>  $00000000005D8DD7 line 5425 of include/wincontrol.inc
>  $0000000000667557 line 528 of include/customedit.inc
>  $000000000082BCE0 line 112 of lclmessageglue.pas
> Call trace for block $00007F712645A7C0 size 20
>  $00000000013CB5CC line 179 of frmspotter.pas
>  $0000000000667CE0 line 652 of include/customedit.inc
>  $0000000000667C5A line 644 of include/customedit.inc
>  $00000000005E7E74 line 1203 of include/control.inc
>  $0000000000431B9F
>  $00000000005D8DD7 line 5425 of include/wincontrol.inc
>  $0000000000667557 line 528 of include/customedit.inc
>  $000000000082BCE0 line 112 of lclmessageglue.pas
> Call trace for block $00007F712645CF80 size 20
>  $00000000013CB5CC line 179 of frmspotter.pas
>  $0000000000667CE0 line 652 of include/customedit.inc
>  $0000000000667C5A line 644 of include/customedit.inc
>  $00000000005E7E74 line 1203 of include/control.inc
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus


More information about the Lazarus mailing list