D22084: Span wayland objects to lifespan of the QApplication

Vlad Zagorodniy noreply at phabricator.kde.org
Tue Jun 25 15:49:58 BST 2019


zzag added a comment.


  Hmm, okay, I see what the problem is.
  
  The proposed patch seems to be reasonable, but I don't like the new object tree. We could fix this bug by introducing m_isTerminating, e.g.
  
    // In setupKWaylandIntegration.
    connect(qApp, &QCoreApplication::aboutToQuick, this, [] {
        // ...
        m_registry->release();
        m_isTerminating = true;
    });
    
    // In each proxy getter.
    
    // A deep touching comment that explains why this proxy is guarded.
    if (m_isTerminating) {
        return nullptr;
    }
  
  these two approaches are inter-changeable, but solution with m_isTerminating has a bit nicer object tree.
  
  In either case, this patch is good to go. I have just one question.

INLINE COMMENTS

> waylandintegration.cpp:125
>                  m_waylandBlurManager->deleteLater();
> -                m_waylandBlurManager = nullptr;
>              }

Is it safe to drop this line? What was the reasoning behind this change?

REPOSITORY
  R130 Frameworks integration plugin using KWayland

REVISION DETAIL
  https://phabricator.kde.org/D22084

To: davidedmundson, #plasma
Cc: apol, ngraham, anthonyfieroni, zzag, plasma-devel, LeGast00n, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190625/4ca7b71c/attachment.html>


More information about the Plasma-devel mailing list