[wayland] Ensure to not call into x11 on Compositor tear-down
During Compositor tear down Xwayland is already destroyed. Thus it doesn't make sense to try to delete the support properties: either it freezes in xcb or it crashes because the connection is null. At the same time we also ensure that the connection internally is reset to null. Note: the one in kwinglobals.h caches and could cause use-after-free errors. Any tear-down code must be migrated to kwinApp()->x11Connection().
This commit is contained in:
parent
acb0dfd893
commit
f75e53af60
3 changed files with 7 additions and 3 deletions
|
@ -56,6 +56,7 @@ WaylandTestApplication::~WaylandTestApplication()
|
|||
Xcb::setInputFocus(XCB_INPUT_FOCUS_POINTER_ROOT);
|
||||
destroyAtoms();
|
||||
xcb_disconnect(x11Connection());
|
||||
setX11Connection(nullptr);
|
||||
}
|
||||
if (m_xwaylandProcess) {
|
||||
m_xwaylandProcess->terminate();
|
||||
|
|
|
@ -443,11 +443,13 @@ void Compositor::deleteUnusedSupportProperties()
|
|||
m_unusedSupportPropertyTimer.start();
|
||||
return;
|
||||
}
|
||||
if (kwinApp()->x11Connection()) {
|
||||
foreach (const xcb_atom_t &atom, m_unusedSupportProperties) {
|
||||
// remove property from root window
|
||||
xcb_delete_property(connection(), rootWindow(), atom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// OpenGL self-check failed, fallback to XRender
|
||||
void Compositor::fallbackToXRenderCompositing()
|
||||
|
|
|
@ -80,6 +80,7 @@ ApplicationWayland::~ApplicationWayland()
|
|||
Xcb::setInputFocus(XCB_INPUT_FOCUS_POINTER_ROOT);
|
||||
destroyAtoms();
|
||||
xcb_disconnect(x11Connection());
|
||||
setX11Connection(nullptr);
|
||||
}
|
||||
if (m_xwaylandProcess) {
|
||||
m_xwaylandProcess->terminate();
|
||||
|
|
Loading…
Reference in a new issue