[Gambas-devel] Bug in QT component 0.93b

Benoit Minisini gambas at ...1...
Sat May 29 23:35:08 CEST 2004


On Thursday 27 May 2004 18:45, Daniel Campos wrote:
> Hello:
>
>
> QT component documentation says:
>
>
> EVENT Delete ( )
>
> Raised just before the control is deleted.
>
>
> So, the control is not yet deleted. However, I've created a project
> with two buttons, and just that code:
>
>
> PUBLIC SUB Button1_Click()
>
>   Button2.Delete
>
> END
>
> PUBLIC SUB Button2_Delete()
>
>   Message.Info (Button2.Text)
>
> END
>
>
> I should be able to read 'Text' property, as Button2 already exists.
> However, the program crashes with a segmentation fault.
>
> Regards,
>
> Daniel Campos

Well, after having read carefully the QT documentation, I saw that this event 
cannot work as written in the documentation. When QT emits the destroy 
signal, the QT object is not in a safe state, so you can't use any of its 
properties.

I will fix the crash by making the object invalid before raising the event.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the Devel mailing list