D16425: Added new Suspend then Hibernate option

Kai Uwe Broulik noreply at phabricator.kde.org
Wed Nov 28 15:05:26 GMT 2018


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20181128/3d27fbb5/attachment.html>


More information about the Plasma-devel mailing list