[Lazarus] Res leaks on exiting gtk2 app

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Lazarus] Res leaks on exiting gtk2 app

Free Pascal - Lazarus mailing list
CudaText app, gtk2 WS. I run it from terminal, it loads dir to Treeview
[only top level of /usr], i exit.

user@user-Notebook:~$ cudatext /usr
CudaText: opening dir: /usr
[TGtk2WidgetSet.Destroy] WARNING: There are 4 unreleased DCs, a detailed
dump follows:
[TGtk2WidgetSet.Destroy]  DCs:   00007F15EAEC7E40 00007F15EAEC5640
00007F15EAEC5440 00007F15EAEC5040
[TGtk2WidgetSet.Destroy] WARNING: There are 19 unreleased GDIObjects, a
detailed dump follows:
[TGtk2WidgetSet.Destroy]   GDIOs: 00007F15E9A73540 00007F15E9A735C0
00007F15E9A73740 00007F15E9A734C0 00007F15E9A73EC0 00007F15E9A73E40
00007F15E9A73B40
[TGtk2WidgetSet.Destroy]   gdiBitmap: 14
[TGtk2WidgetSet.Destroy]   gdiBrush: 2
[TGtk2WidgetSet.Destroy]   gdiPen: 2
[TGtk2WidgetSet.Destroy]   gdiRegion: 1
user@user-Notebook:~$


--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] Res leaks on exiting gtk2 app

Free Pascal - Lazarus mailing list
  [TGtk2WidgetSet.Destroy] WARNING: There are 19 unreleased GDIObjects,
a detailed dump follows:

I see I have 19 icons in app, in 3..4 ImageLists. so all icons from
Imagelists leaked? ImageLists placed in design time. They must free by LCL.

--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] Res leaks on exiting gtk2 app

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Wed, 14 Jun 2017 12:02:34 +0300
Alexey via Lazarus <[hidden email]> wrote:

> CudaText app, gtk2 WS. I run it from terminal, it loads dir to Treeview
> [only top level of /usr], i exit.

Why do you think this is a bug in the LCL, and not in cudatext?

 
> user@user-Notebook:~$ cudatext /usr
> CudaText: opening dir: /usr
> [TGtk2WidgetSet.Destroy] WARNING: There are 4 unreleased DCs, a detailed
> dump follows:

Mattias
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] Res leaks on exiting gtk2 app

Free Pascal - Lazarus mailing list
On 14.06.2017 12:14, Mattias Gaertner via Lazarus wrote:
> Why do you think this is a bug in the LCL, and not in cudatext?

I wrote that I have 4 imagelists with 19 icons [imagelists created in
design time, icons load some in runtume, some in design time], and 19
objects leak.

--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] Res leaks on exiting gtk2 app

Free Pascal - Lazarus mailing list
On Wed, 14 Jun 2017 12:25:52 +0300
Alexey via Lazarus <[hidden email]> wrote:

> On 14.06.2017 12:14, Mattias Gaertner via Lazarus wrote:
> > Why do you think this is a bug in the LCL, and not in cudatext?  
>
> I wrote that I have 4 imagelists with 19 icons [imagelists created in
> design time, icons load some in runtume, some in design time], and 19
> objects leak.

Please test if you can reproduce this in a small project.
If yes, please create a bug report.

Mattias
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] Res leaks on exiting gtk2 app

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list


On Wed, 14 Jun 2017, Mattias Gaertner via Lazarus wrote:

> On Wed, 14 Jun 2017 12:02:34 +0300
> Alexey via Lazarus <[hidden email]> wrote:
>
>> CudaText app, gtk2 WS. I run it from terminal, it loads dir to Treeview
>> [only top level of /usr], i exit.
>
> Why do you think this is a bug in the LCL, and not in cudatext?

Well, seeing it is GTK2, for example I consistently get this when exiting the IDE:

TApplication.HandleException Access violation
   Stack trace:
   $0000000000000000
   $000000000062406E line 69 of include/toolbutton.inc
   $0000000000623FF6 line 116 of include/toolbutton.inc
   $00000000005B3468 line 2278 of include/control.inc
   $00000000005B38F1 line 2416 of include/control.inc
   $00000000004369E2 line 602 of ../inc/objpas.inc
   $00000000005B336D line 2238 of include/control.inc
   $00000000005B19F6 line 1560 of include/control.inc
   $00000000005A486C line 4734 of include/wincontrol.inc
   $00000000005A5EA1 line 5361 of include/wincontrol.inc
   $000000000077341C line 112 of lclmessageglue.pas
   $000000000066D0A1 line 3702 of gtk2/gtk2proc.inc
   $000000000067BDE9 line 2141 of gtk2/gtk2callback.inc
   $000000000067B4D8 line 1899 of gtk2/gtk2callback.inc
   $00007F74A6B9BAFC
Exception at 0000000000000000: EAccessViolation:
Access violation.

(lazarus:12951): GLib-GObject-CRITICAL **: g_object_get_data: assertion 'G_IS_OBJECT (object)' failed
TApplication.HandleException Access violation
   Stack trace:
   $00000000004368BC line 539 of ../inc/objpas.inc
   $00000000004359E6 line 42 of ../inc/objpas.inc
   $000000000067B3F5 line 1767 of gtk2/gtk2callback.inc
   $000000000067B53E line 1914 of gtk2/gtk2callback.inc
   $00007F74A6B9BAFC
Exception at 00000000004368BC: EAccessViolation:
Access violation.
LAZARUS END - cleaning up ...
[FORMS.PP] ExceptionOccurred
   Sender=EAccessViolation
   Exception=Access violation
   Stack trace:
   $00007F74A6837820
TApplication.HandleException Access violation
   Stack trace:
   $00007F74A6837820
Exception at 00007F74A6837820: EAccessViolation:
Access violation.


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] Res leaks on exiting gtk2 app

Free Pascal - Lazarus mailing list
On Wed, 14 Jun 2017 11:42:41 +0200 (CEST)
Michael Van Canneyt via Lazarus <[hidden email]> wrote:

> On Wed, 14 Jun 2017, Mattias Gaertner via Lazarus wrote:
>
> > On Wed, 14 Jun 2017 12:02:34 +0300
> > Alexey via Lazarus <[hidden email]> wrote:
> >  
> >> CudaText app, gtk2 WS. I run it from terminal, it loads dir to Treeview
> >> [only top level of /usr], i exit.  
> >
> > Why do you think this is a bug in the LCL, and not in cudatext?  
>
> Well, seeing it is GTK2, for example I consistently get this when exiting the IDE:
>
> TApplication.HandleException Access violation
>    Stack trace:
>    $0000000000000000
>    $000000000062406E line 69 of include/toolbutton.inc

This is apparently something else.
It is normal to get unreleased DCs after an AV.

Can you create a full stack trace with gdb and open another mail thread?

Mattias
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] Res leaks on exiting gtk2 app

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 14.06.2017 12:38, Mattias Gaertner via Lazarus wrote:
> reproduce this in a small project.

Cannot repeat it : event with my custom controls and Python. Leak is
here only after i open folder in Cudatext [it calls Python engine to
load filelist and show it in Treeview].

--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] Res leaks on exiting gtk2 app

Free Pascal - Lazarus mailing list
On Wed, 14 Jun 2017 13:30:03 +0300
Alexey via Lazarus <[hidden email]> wrote:

> On 14.06.2017 12:38, Mattias Gaertner via Lazarus wrote:
> > reproduce this in a small project.  
>
> Cannot repeat it : event with my custom controls and Python. Leak is
> here only after i open folder in Cudatext [it calls Python engine to
> load filelist and show it in Treeview].

If you can't provide a simple example, then you must debug it yourself.
Check if the imagelist is freed.

Mattias
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] Res leaks on exiting gtk2 app

Free Pascal - Lazarus mailing list
  I think Imagelist is freed [it must be] but WS gtk2 don't free it's
handles or smth, can it be like it?
CudaText gives leak not always. Maybe some lock in gtk2.
> If you can't provide a simple example, then you must debug it yourself.
> Check if the imagelist is freed.
>
> Mattias


--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] Res leaks on exiting gtk2 app

Free Pascal - Lazarus mailing list
On Mon, 26 Jun 2017 21:50:57 +0300
Alexey via Lazarus <[hidden email]> wrote:

>   I think Imagelist is freed [it must be] but WS gtk2 don't free it's
> handles or smth, can it be like it?
> CudaText gives leak not always. Maybe some lock in gtk2.

Since you are the only one with this problem, it must be something you
are doing with the imagelist.
You must give some clues what you are doing otherwise no one can help.

Mattias

> > If you can't provide a simple example, then you must debug it yourself.
> > Check if the imagelist is freed.
> >
> > Mattias  
>
>
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] Res leaks on exiting gtk2 app

Free Pascal - Lazarus mailing list
On 27.06.2017 00:22, Mattias Gaertner via Lazarus wrote:
>   it must be something you
> are doing with the imagelist.
> You must give some clues what you are doing otherwise no one can help.

I'm doing loading of png files [Imagelist size 16x] to it--


function UpdateImagelistWithIconFromFile(AImagelist: TCustomImagelist;
   const AFilename: string): boolean;
var
   bmp: TCustomBitmap;
begin
   Result:= false;
   if AImagelist=nil then exit;
   if not FileExistsUtf8(AFilename) then exit;

   if ExtractFileExt(AFilename)='.bmp' then
     bmp:= TBitmap.Create
   else
   if ExtractFileExt(AFilename)='.png' then
     bmp:= TPortableNetworkGraphic.Create
   else
     exit;

   try
     try
       bmp.LoadFromFile(AFilename);
       bmp.Transparent:= true;
       AImagelist.Add(bmp, nil);
       Result:= true;
     finally
       FreeAndNil(bmp);
     end;
   except
   end;
end;

for many icons.

--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Loading...