Use QPointer to monitor input method server connection.

Input method may crash and leave a dangling pointer. DBus interface may
access the invalid pointer and crash kwin.
master
Weng Xuetian 3 years ago committed by Aleix Pol Gonzalez
parent d66be7b99f
commit 7a270b5d78

@ -206,6 +206,11 @@ KWaylandServer::ClientConnection *WaylandServer::xWaylandConnection() const
return m_xwaylandConnection;
}
KWaylandServer::ClientConnection *WaylandServer::inputMethodConnection() const
{
return m_inputMethodServerConnection;
}
void WaylandServer::registerShellClient(AbstractClient *client)
{
if (client->isLockScreen()) {

@ -180,9 +180,7 @@ public:
void initWorkspace();
KWaylandServer::ClientConnection *xWaylandConnection() const;
KWaylandServer::ClientConnection *inputMethodConnection() const {
return m_inputMethodServerConnection;
}
KWaylandServer::ClientConnection *inputMethodConnection() const;
KWaylandServer::ClientConnection *screenLockerClientConnection() const {
return m_screenLockerClientConnection;
}
@ -266,7 +264,7 @@ private:
QSet<KWaylandServer::LinuxDmaBufV1ClientBuffer*> m_linuxDmabufBuffers;
QPointer<KWaylandServer::ClientConnection> m_xwaylandConnection;
KWaylandServer::InputMethodV1Interface *m_inputMethod = nullptr;
KWaylandServer::ClientConnection *m_inputMethodServerConnection = nullptr;
QPointer<KWaylandServer::ClientConnection> m_inputMethodServerConnection;
KWaylandServer::ClientConnection *m_screenLockerClientConnection = nullptr;
KWaylandServer::XdgForeignV2Interface *m_XdgForeign = nullptr;
KWaylandServer::KeyStateInterface *m_keyState = nullptr;

Loading…
Cancel
Save