[Gambas-devel] Gambas module for QT embedded and stack overflow error deleting objects
Benoit Minisini
gambas at ...1...
Tue Nov 7 23:04:29 CET 2006
On Tuesday 07 November 2006 18:32, Silvan Calarco wrote:
> Hi,
> I've made a patch to the gambas Qt module to make it build against
> Qt/Embedded. Most of the work consisted in adapting the build scripts and
> commenting out any calls to X specific functions (I suppose most don't need
> any replacement because relate on X functionalities not available/needed
> with the framebuffer). The current (early stage) patch is attached and I've
> tested it with gambas 1.9.44.
Great job!
> The Qt/embedded module support could be added
> to mainstream Gambas but the scripts should be modified to make both Qt and
> Qte modules from the same sources, that's a thing I haven't done.
I will do that.
In the future, I should find a way to automatically select between gb.qt or
gb.qte. If you have an idea of how to detect which one should be used...
And if you can search if there is a way to replace some functions when there
is no equivalent to the Qt function or X11 function. For example, we can't
return 0 for Desktop.Resolution, so what should be returned?
> The test results in framebuffer environment are conforting but I'm
> currently having a stack overflow issue when Deleting graphical objects.
> The following code associated to a button:
>
> PUBLIC SUB TestButton_Click()
> DIM a AS label
> DIM i AS Integer
> FOR i = 0 TO 20000
> a = NEW label(ME)
> label1.text = Str(i)
> a.Delete
> WAIT
> NEXT
>
> Stops after 502 cycles with a stack overflow error. I thought it was
> related to the Qt/embedded module but when I ran it against X it stopped
> with the error too after 985 cycles. The tests have been done with the
> stack size set as 'default'. With different stack size values the resulting
> cycles before the error are proportional.
> Is the code wrong or its behaviour ?
Your code is right. It seems that there is a stack leak when a widget is
destroyed. I will investigate...
>
> Cheers,
> Silvan
Regards,
--
Benoit Minisini
More information about the Devel
mailing list