broulik added a comment.
I think that's because we're iterating `m_cookieToBusService` in that method and at the same time have `ReleaseInhibition` tamper with it. Perhaps taking a copy should fix that already: void PolicyAgent::onServiceUnregistered(const QString& serviceName) { // Ouch - the application quit or crashed without releasing its inhibitions. Let's fix that. const auto cookieToBusService = m_cookieToBusService; for (auto it = cookieToBusService.constBegin(); it != cookieToBusService.constEnd(); ++it) { if (it.value() == serviceName) { ReleaseInhibition(it.key()); } } m_cookieToBusService.clear(); } REPOSITORY R122 Powerdevil REVISION DETAIL https://phabricator.kde.org/D16425 To: avaldes, broulik Cc: graesslin, ngraham, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart