diff --git a/debian/changelog b/debian/changelog --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +lxqt-policykit (0.16.0-1ubuntu2) hirsute; urgency=medium + + * Fix crashes with more than one sudoer (LP: #1875774) + - Added patch better-memory-handling.diff + + -- apt-ghetto Fri, 05 Nov 2021 17:53:25 +0100 + lxqt-policykit (0.16.0-1ubuntu1) hirsute; urgency=medium * New upstream version. diff --git a/debian/patches/better-memory-handling.diff b/debian/patches/better-memory-handling.diff new file mode 100644 --- /dev/null +++ b/debian/patches/better-memory-handling.diff @@ -0,0 +1,68 @@ +Author: Palo Kisa +Origin: https://github.com/lxqt/lxqt-policykit/commit/fc57746b8ccb62536ef158a1b01b47ef327c7fbd.patch +Description: PolicykitAgent: Add better memory handling + Don't delete the session in the slot as we can't be sure if any other + activity is done on the sender object after our slot finishes. +Bug: https://github.com/lxqt/lxqt-policykit/issues/105 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxqt-policykit/+bug/1875774 +Last-Update: 2021-09-06 +--- + src/policykitagent.cpp | 13 ++++++++++--- + src/policykitagent.h | 3 +++ + 2 files changed, 13 insertions(+), 3 deletions(-) + +--- a/src/policykitagent.cpp ++++ b/src/policykitagent.cpp +@@ -59,6 +59,14 @@ PolicykitAgent::~PolicykitAgent() + if(m_infobox) { + delete m_infobox; + } ++ deleteSessions(); ++} ++ ++void PolicykitAgent::deleteSessions() ++{ ++ for (auto i = m_SessionIdentity.begin(), i_e = m_SessionIdentity.end(); i != i_e; ++i) ++ delete i.key(); ++ m_SessionIdentity.clear(); + } + + +@@ -76,7 +84,7 @@ void PolicykitAgent::initiateAuthenticat + return; + } + m_inProgress = true; +- m_SessionIdentity.clear(); ++ deleteSessions(); + + if (m_gui) + { +@@ -138,7 +146,7 @@ void PolicykitAgent::completed(bool gain + Q_ASSERT(session); + Q_ASSERT(m_gui); + +- if (m_gui->identity() == m_SessionIdentity[session].toString()) ++ if (m_inProgress && m_gui->identity() == m_SessionIdentity[session].toString()) + { + if (!gainedAuthorization) + { +@@ -154,7 +162,6 @@ void PolicykitAgent::completed(bool gain + m_infobox->hide(); + delete m_infobox; + } +- delete session; + } + + void PolicykitAgent::showError(const QString &text) +--- a/src/policykitagent.h ++++ b/src/policykitagent.h +@@ -68,6 +68,9 @@ public slots: + void showError(const QString &text); + void showInfo(const QString &text); + ++protected: ++ void deleteSessions(); ++ + private: + bool m_inProgress; + PolicykitAgentGUI * m_gui; diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +better-memory-handling.diff