From kde-bindings Mon Feb 15 18:58:25 2010 From: Richard Dale Date: Mon, 15 Feb 2010 18:58:25 +0000 To: kde-bindings Subject: Re: [Kde-bindings] Qt, Qyoto buttons work intermediately Message-Id: <201002151858.26635.rdale () telefonica ! net> X-MARC-Message: https://marc.info/?l=kde-bindings&m=126626037115649 On Monday 15 February 2010 06:20:04 pm Robert Riemann wrote: > > Yes, Richard was right. In your main.cs file your create the MainWindow > > simply with > > new MainWindow(); > > but don't save it in a variable. The GC thinks it is now eligible for > > collection since there are no other references to it anymore. > > I had already committed a fix a while back that should have prevented > > visible top-level widgets from being collected, but I didn't cover every > > possibility. I just committed another fix which makes this works. Thanks > > for the report! > > I think such kind of fixes should be removed from trunk. Using widgets > without a reference seems to be dirty coding style to me, > which doesn't need to be supported. Well most Qt language bindings do attempt to support this. For instance, in QtRuby during the garbage collection mark phase, the QtRuby runtime traverses the QObject heirarchies and marks everything in the trees as still in use. So in the case of a QMainWindow, maybe it has the QApplication as a parent, even though there isn't an instance of the window live in the application code, it can still be treated as a live reference and kept. > Trying to fixing it would be something like a workaround which isn't > really necessary imho, but creates overhead. > > I vote for removing these workarounds. Well it depends what you mean be a workround. I'm not so sure trapping show and hide events is a good idea, but at the moment I think the trunk is a good place to experiment as we don't have a new KDE release for about six months. -- Richard > > PS: Please consider I have nearly no idea of good coding style myself. > Just "speaking" out loud my thoughts... > _______________________________________________ > Kde-bindings mailing list > Kde-bindings@kde.org > https://mail.kde.org/mailman/listinfo/kde-bindings _______________________________________________ Kde-bindings mailing list Kde-bindings@kde.org https://mail.kde.org/mailman/listinfo/kde-bindings