Commit Graph

2 Commits (8510f31340ac78d76df69a3bccb001f610613913)

Author SHA1 Message Date
Martin Gräßlin d345878b52 [autotests] Add Q_CONSTRUCTOR_FUNCTION to X11 specific tests to force xcb
The X11 specific tests need to run on QT_QPA_PLATFORM xcb otherwise
they will crash. To enforce this without having to replace QTEST_MAIN
a Q_CONSTRUCTOR_FUNCTION is used to invoke a function which does nothing
except setting the env variable.
2016-09-08 15:22:48 +02:00
Martin Gräßlin d49fba5d30 [libkwinxrenderutils] Clean up static blend picture before going down
Summary:
The method xRenderBlendPicture created a static XRenderPicture on
first usage. To cleanup a XRenderPicture an xcb_connection_t* is needed.
As it's static the cleanup happens on exit handler and at that time Qt
already destroyed the xcb_connection_t*. With a certain chance this will
crash.

To expose the problem a Q_ASSERT(qApp) is added in the destructor of
XRenderPicture. Using xrenderBlendPicture() will hit this assert on
application exit. This is demonstrated by the added auto test.

The actual fix to the problem is moving the static variable out of
the method and introduce a global cleanup method just like the init
method. This is now called from Workspace dtor, so before application
goes down.

CCBUG: 363251

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1731
2016-06-13 15:29:07 +02:00