QGlobalStatic and windowing specific calls in dtor

Martin Graesslin mgraesslin at kde.org
Tue May 31 08:58:44 UTC 2016


On Monday, May 30, 2016 5:50:23 PM CEST Aleix Pol wrote:
> On Mon, May 30, 2016 at 4:25 PM, Martin Graesslin <mgraesslin at kde.org> 
wrote:
> > Hi frameworks-dev,
> > 
> > I have a problem with my KWayland based plugin for KIdleTime. KIdleTime
> > uses a QGlobalStatic, so it gets destroyed at exit-time. At that point
> > the QGuiApplication and the qpa plugin does not exist any more, so any
> > windowing system specific calls will fail.
> > 
> > In the case of the KWayland based plugin, KWayland performs cleanup calls
> > which crash as the wayland connection got already destroyed. In principle
> > the same could also happen for the other plugins - they just don't
> > perform any cleanup and prefer to leak X resources.
> > 
> > So what's the best way to handle such a situation? How can I tear-down the
> > plugin in a clean way without crashing?
> 
> It should clean up when aboutToQuit is emitted.
> http://doc.qt.io/qt-5/qcoreapplication.html#aboutToQuit

Thanks, yes that should work. Though just when I wanted to reproduce the 
actual problem I failed to do so. /me is confused.

Cheers
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160531/a74004f5/attachment-0001.sig>


More information about the Kde-frameworks-devel mailing list