[wayland] Ensure KWin::atoms are destroyed before doing xcb_disconnect

Destroying the Atoms might call into xcb as a request might have to be
discarded. If atoms are destroyed after disconnecting xcb, this'll crash.
icc-effect-5.14.5
Martin Gräßlin 2015-05-26 14:26:56 +02:00
parent f81655b7f5
commit c798977e55
3 changed files with 8 additions and 0 deletions

View File

@ -200,7 +200,13 @@ void Application::start()
Application::~Application()
{
delete options;
destroyAtoms();
}
void Application::destroyAtoms()
{
delete atoms;
atoms = nullptr;
}
void Application::crashChecking()

1
main.h
View File

@ -181,6 +181,7 @@ protected:
m_connection = c;
emit x11ConnectionChanged();
}
void destroyAtoms();
bool notify(QObject* o, QEvent* e);
static void crashHandler(int signal);

View File

@ -76,6 +76,7 @@ ApplicationWayland::~ApplicationWayland()
destroyWorkspace();
if (x11Connection()) {
Xcb::setInputFocus(XCB_INPUT_FOCUS_POINTER_ROOT);
destroyAtoms();
xcb_disconnect(x11Connection());
}
if (m_xwaylandProcess) {