[Kde-bindings] QtRuby section in my book
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Thu Apr 6 11:06:34 UTC 2006
On Thursday 06 April 2006 11:33, Caleb Tennis wrote:
> > Once the layout is added to the widget, the layout and its widgets are
> > children of MyWidget, so you don't really need to do this:
>
> Is that just Qt4ish? I didn't think this was the case with Qt3.
Yes, I think it changed in Qt4.
Someone reported a strange bug where they had a very long operation in a Qt4
QtRuby constructor, fetching things from the net, and the Ruby garbage
collector was being called while still in the constructor. But the
parents/children hadn't be set up yet because the layout hadn't be added to
its owning widget, and therefore the QtRuby runtime couldn't mark the widgets
as not needing garbage collection, and they were being wrongly freed.
Possibly adding the widgets passed in a block to the layout constructor might
help to get round that problem. The only solution in the end was to turn off
Ruby garbage collection until the lengthy constructor call was complete.
-- Richard
More information about the Kde-bindings
mailing list