diff --git a/autotests/wayland/kwin_wayland_test.cpp b/autotests/wayland/kwin_wayland_test.cpp index 2c1a01d9ee..a5787e33e3 100644 --- a/autotests/wayland/kwin_wayland_test.cpp +++ b/autotests/wayland/kwin_wayland_test.cpp @@ -57,6 +57,7 @@ WaylandTestApplication::~WaylandTestApplication() if (effects) { static_cast(effects)->unloadAllEffects(); } + disconnect(m_xwaylandFailConnection); if (x11Connection()) { Xcb::setInputFocus(XCB_INPUT_FOCUS_POINTER_ROOT); destroyAtoms(); @@ -225,7 +226,7 @@ void WaylandTestApplication::startXwaylandServer() QStringLiteral("-rootless"), QStringLiteral("-wm"), QString::number(fd)}); - connect(m_xwaylandProcess, static_cast(&QProcess::error), this, + m_xwaylandFailConnection = connect(m_xwaylandProcess, static_cast(&QProcess::error), this, [] (QProcess::ProcessError error) { if (error == QProcess::FailedToStart) { std::cerr << "FATAL ERROR: failed to start Xwayland" << std::endl; diff --git a/autotests/wayland/kwin_wayland_test.h b/autotests/wayland/kwin_wayland_test.h index 5d07c257e3..9599b3fe3b 100644 --- a/autotests/wayland/kwin_wayland_test.h +++ b/autotests/wayland/kwin_wayland_test.h @@ -47,6 +47,7 @@ private: int m_xcbConnectionFd = -1; QProcess *m_xwaylandProcess = nullptr; + QMetaObject::Connection m_xwaylandFailConnection; }; } diff --git a/main_wayland.cpp b/main_wayland.cpp index 7c4f8570f4..d5bb2156eb 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -81,6 +81,7 @@ ApplicationWayland::~ApplicationWayland() if (effects) { static_cast(effects)->unloadAllEffects(); } + disconnect(m_xwaylandFailConnection); if (x11Connection()) { Xcb::setInputFocus(XCB_INPUT_FOCUS_POINTER_ROOT); destroyAtoms(); @@ -293,7 +294,7 @@ void ApplicationWayland::startXwaylandServer() QStringLiteral("-rootless"), QStringLiteral("-wm"), QString::number(fd)}); - connect(m_xwaylandProcess, static_cast(&QProcess::error), this, + m_xwaylandFailConnection = connect(m_xwaylandProcess, static_cast(&QProcess::error), this, [] (QProcess::ProcessError error) { if (error == QProcess::FailedToStart) { std::cerr << "FATAL ERROR: failed to start Xwayland" << std::endl; diff --git a/main_wayland.h b/main_wayland.h index fd95bd7481..e5d7c962b4 100644 --- a/main_wayland.h +++ b/main_wayland.h @@ -66,6 +66,7 @@ private: QStringList m_applicationsToStart; QString m_inputMethodServerToStart; QProcess *m_xwaylandProcess = nullptr; + QMetaObject::Connection m_xwaylandFailConnection; QProcessEnvironment m_environment; };