[lazarus] AV on messagedialogs?

Michal Bukovjan bukovjan at mbox.dkm.cz
Wed Sep 4 10:58:44 EDT 2002


Mattias Gaertner wrote:

>On Wed, 04 Sep 2002 01:12:25 +0200
>Florian Klaempfl <Florian.Klaempfl at gmx.de> wrote:
>
>  
>
>>At 00:01 04.09.2002 +0200, you wrote:
>>
>>    
>>
>>>I found that it perhaps crashes during the dialog show, but was unable to 
>>>find more yet, as gdb was not of much help. This looks like dangling 
>>>pointers or memory overwriting to me.
>>>      
>>>
>
>gdb helped me to find out:
>The crash comes with the gtk_accel_group_add statements. For example for TBitBtn. Probably the accelerators were not released, when the widgets were destroyed or the accelerator changes. Probably the people who implemented the accelerator stuff have an idea where to start.
>
>  
>
Yes, that was the code. GTK does not release accelerators upon widget 
destroy, and thus there remains a dangling pointer in accelerator group.
As soon as you try to add the same accelerator for a second time, it 
tries to remove existing accelerator for now non-existent object and GTK 
crashes.

This is now fixed by always releasing all accelererators upon widget 
destroy.

Michal







More information about the Lazarus mailing list