diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-04-16 13:07:24 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-04-16 13:07:24 +0100 |
commit | 0c100b7dd2b30e75b799d806df4ef899fd98e1ea (patch) | |
tree | 464c922e949c7e4d5d891fb2cdda5daee5612537 /kde-frameworks/kidletime/files/kidletime-5.92.0-crashfix.patch | |
parent | e68d405c5d712af4387159df07e226217bdda049 (diff) |
gentoo resync : 16.04.2022
Diffstat (limited to 'kde-frameworks/kidletime/files/kidletime-5.92.0-crashfix.patch')
-rw-r--r-- | kde-frameworks/kidletime/files/kidletime-5.92.0-crashfix.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/kde-frameworks/kidletime/files/kidletime-5.92.0-crashfix.patch b/kde-frameworks/kidletime/files/kidletime-5.92.0-crashfix.patch new file mode 100644 index 000000000000..93a016d76fd0 --- /dev/null +++ b/kde-frameworks/kidletime/files/kidletime-5.92.0-crashfix.patch @@ -0,0 +1,41 @@ +From cd5040684723b87c7ba5b7cc1b1a63402902a641 Mon Sep 17 00:00:00 2001 +From: Ada Christine <adachristine18@gmail.com> +Date: Sun, 27 Mar 2022 01:29:09 +0000 +Subject: [PATCH] Fixed crash during KIdleTime::timeoutReached() + +timeoutReached() will cause a crash if an item is removed from associations +during signal dispatch due to iterator invalidation. iterate over a +const container of the assoication keys only triggering ones matching +the current timeout value to avoid the crash and unnecessary copying + +BUG: 451946 +--- + src/kidletime.cpp | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/kidletime.cpp b/src/kidletime.cpp +index a58eaa6..0929285 100644 +--- a/src/kidletime.cpp ++++ b/src/kidletime.cpp +@@ -288,13 +288,13 @@ void KIdleTimePrivate::timeoutReached(int msec) + { + Q_Q(KIdleTime); + +- for (auto it = associations.cbegin(); it != associations.cend(); ++it) { +- if (it.value() == msec) { ++ const auto listKeys = associations.keys(msec); ++ ++ for (const auto key : listKeys) { + #if KIDLETIME_BUILD_DEPRECATED_SINCE(5, 76) +- Q_EMIT q->timeoutReached(it.key()); ++ Q_EMIT q->timeoutReached(key); + #endif +- Q_EMIT q->timeoutReached(it.key(), msec); +- } ++ Q_EMIT q->timeoutReached(key, msec); + } + } + +-- +GitLab + |