Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package powerdevil6 for openSUSE:Factory 
checked in at 2024-07-26 16:14:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/powerdevil6 (Old)
 and      /work/SRC/openSUSE:Factory/.powerdevil6.new.1882 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "powerdevil6"

Fri Jul 26 16:14:12 2024 rev:11 rq:1189503 version:6.1.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/powerdevil6/powerdevil6.changes  2024-07-17 
15:14:01.751614583 +0200
+++ /work/SRC/openSUSE:Factory/.powerdevil6.new.1882/powerdevil6.changes        
2024-07-26 16:15:01.768567868 +0200
@@ -1,0 +2,6 @@
+Wed Jul 24 17:23:00 UTC 2024 - Fabian Vogt <[email protected]>
+
+- Add patch to fix crash on display wake up (kde#490356, kde#490421):
+  * 0001-daemon-Don-t-leave-dangling-Action-pointers-in-idle-.patch
+
+-------------------------------------------------------------------

New:
----
  0001-daemon-Don-t-leave-dangling-Action-pointers-in-idle-.patch

BETA DEBUG BEGIN:
  New:- Add patch to fix crash on display wake up (kde#490356, kde#490421):
  * 0001-daemon-Don-t-leave-dangling-Action-pointers-in-idle-.patch
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ powerdevil6.spec ++++++
--- /var/tmp/diff_new_pack.qgQlBi/_old  2024-07-26 16:15:02.580600578 +0200
+++ /var/tmp/diff_new_pack.qgQlBi/_new  2024-07-26 16:15:02.580600578 +0200
@@ -36,6 +36,8 @@
 Source1:        
https://download.kde.org/stable/plasma/%{version}/%{rname}-%{version}.tar.xz.sig
 Source2:        plasma.keyring
 %endif
+# PATCH-FIX-UPSTREAM
+Patch1:         0001-daemon-Don-t-leave-dangling-Action-pointers-in-idle-.patch
 BuildRequires:  kf6-extra-cmake-modules >= %{kf6_version}
 # Needed by FindLibcap.cmake
 BuildRequires:  libcap-progs

++++++ 0001-daemon-Don-t-leave-dangling-Action-pointers-in-idle-.patch ++++++
>From 8c1686c9e97edb9a06e06e2f41cfe5351cef7986 Mon Sep 17 00:00:00 2001
From: Jakob Petsovits <[email protected]>
Date: Thu, 18 Jul 2024 17:14:06 +0000
Subject: [PATCH] daemon: Don't leave dangling Action pointers in idle-time
 containers

If we delete the Action but don't clean up related map/set elements,
the powerdevil daemon can crash e.g. in Core::onResumingFromIdle()
and Core::onKIdleTimeoutReached().

This has been an issue since commit 584cfdf0 (or d91bc62f on 6.1)
which made it possible for already-created actions to get deleted
again at a later time.

BUG: 490356
BUG: 490421


(cherry picked from commit 7a929fa01ed036f60c5a15c72416b4e40eb03160)

Co-authored-by: Jakob Petsovits <[email protected]>
---
 daemon/powerdevilcore.cpp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp
index 915ca0ad..838b5c05 100644
--- a/daemon/powerdevilcore.cpp
+++ b/daemon/powerdevilcore.cpp
@@ -224,10 +224,16 @@ void Core::refreshActions()
     }
 
     // Remove now-unsupported actions
-    std::erase_if(m_actionPool, [](const auto &pair) {
-        const auto &[name, action] = pair;
-        return !action->isSupported();
-    });
+    for (auto it = m_actionPool.begin(); it != m_actionPool.end();) {
+        Action *action = it->second.get();
+        if (!action->isSupported()) {
+            m_registeredActionTimeouts.remove(action);
+            m_pendingResumeFromIdleActions.remove(action);
+            it = m_actionPool.erase(it);
+        } else {
+            ++it;
+        }
+    }
 }
 
 bool Core::isActionSupported(const QString &actionName)
-- 
2.45.2

Reply via email to