<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/120110/">https://git.reviewboard.kde.org/r/120110/</a>
     </td>
    </tr>
   </table>
   <br />





<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KDE Frameworks and Plasma.</div>
<div>By Joseph Wenninger.</div>


<p style="color: grey;"><i>Updated Sept. 9, 2014, 11:48 vorm.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">make lambda disconnect correctly</pre>
  </td>
 </tr>
</table>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-framework
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Fix a crash when shutting down plasma shell, while destruction models</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">While porting the kate session applet to plasma KF5, I noticed plasmashell crashing while using "kquitapp5 plasmashell" while destroying the model in the clipboard engine and in my engine (which is based on the clipboard engine). </p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The problem for me was, that the lambda  in Plasma::DataEngine:167 accessed m_models, which was/is not valid anymore.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Thread 1 (Thread 0x7f2f4cadb880 (LWP 4241)):<br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
[KCrash Handler]</p>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">6  0x00007f2f488336df in QQmlOpenMetaObject::setValue(QByteArray const&, QVariant const&) () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Qml.so.5</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">7  0x00007f2f486c6d14 in QQmlPropertyMap::clear(QString const&) () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Qml.so.5</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">8  0x00007f2f2dfb94e4 in Plasma::DataSource::<lambda()>::operator()(void) const (__closure=0x7fffb8e86670) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/declarativeimports/core/datasource.cpp:167</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">9  0x00007f2f2dfb9b88 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, Plasma::DataSource::modelChanged(const QString&, QAbstractItemModel<em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">)::<lambda()> >::call(Plasma::DataSource::<lambda()>, void </em>*) (f=..., arg=0x7fffb8e86800) at /home/jowenn/KDE/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:502</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">10 0x00007f2f2dfb9b5e in QtPrivate::Functor<Plasma::DataSource::modelChanged(const QString&, QAbstractItemModel<em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">)::<lambda()>, 0>::call<QtPrivate::List<>, void>(Plasma::DataSource::<lambda()> &, void </em>, void **) (f=..., arg=0x7fffb8e86800) at /home/jowenn/KDE/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:559</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">11 0x00007f2f2dfb9b13 in QtPrivate::QFunctorSlotObject<Plasma::DataSource::modelChanged(const QString&, QAbstractItemModel<em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase </em>, QObject <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">, void </em><em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">, bool </em>) (which=1, this_=0x56aee80, r=0x5776340, a=0x7fffb8e86800, ret=0x0) at /home/jowenn/KDE/qt5/qtbase/src/corelib/kernel/qobject_impl.h:200</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">12 0x00007f2f459656be in QMetaObject::activate(QObject<em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">, int, int, void</em>*) () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">13 0x00007f2f4596609f in QObject::destroyed(QObject*) () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">14 0x00007f2f4596d70b in QObject::~QObject() () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">15 0x00007f2f458ddd1d in QAbstractItemModel::~QAbstractItemModel() () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">16 0x00007f2e401af49e in KateSessionsModel::~KateSessionsModel (this=0x5776340, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/kde/applications/kate/addons/sessionapplet/engine/katesessionsmodel.cpp:59</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">17 0x00007f2e401af4ce in KateSessionsModel::~KateSessionsModel (this=0x5776340, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/kde/applications/kate/addons/sessionapplet/engine/katesessionsmodel.cpp:61</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">18 0x00007f2f4596460c in QObjectPrivate::deleteChildren() () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">19 0x00007f2f4596d493 in QObject::~QObject() () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">20 0x00007f2f4b644e47 in Plasma::DataContainer::~DataContainer (this=0x5775ef0, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/plasma/datacontainer.cpp:37</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">21 0x00007f2f4b644e76 in Plasma::DataContainer::~DataContainer (this=0x5775ef0, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/plasma/datacontainer.cpp:40</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">22 0x00007f2f4596460c in QObjectPrivate::deleteChildren() () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">23 0x00007f2f4596d493 in QObject::~QObject() () from /home/jowenn/KDE/qt5/qtbase/lib/libQt5Core.so.5</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">24 0x00007f2f4b648c21 in Plasma::DataEngine::~DataEngine (this=0x5774b50, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/plasma/dataengine.cpp:76</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">25 0x00007f2e401ae418 in KateSessionsEngine::~KateSessionsEngine (this=0x5774b50, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/kde/applications/kate/addons/sessionapplet/engine/katesessionsengine.cpp:36</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">26 0x00007f2e401ae448 in KateSessionsEngine::~KateSessionsEngine (this=0x5774b50, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/kde/applications/kate/addons/sessionapplet/engine/katesessionsengine.cpp:38</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">27 0x00007f2f4b65133d in Plasma::DataEngineManager::unloadEngine (this=0x7f2f4b8dc7c0 <Plasma::(anonymous namespace)::Q_QGS_privateDataEngineManagerSelf::innerFunction()::holder>, name=...) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/plasma/private/dataenginemanager.cpp:159</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">28 0x00007f2f4b64cc6d in Plasma::DataEngineConsumer::~DataEngineConsumer (this=0x552c070, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/plasma/dataengineconsumer.cpp:85</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">29 0x00007f2f2dfa523a in Plasma::DataSource::~DataSource (this=0x552c060, __in_chrg=<optimized out>) at /home/jowenn/KDE/kf5/src/frameworks/plasma-framework/src/declarativeimports/core/datasource.h:43</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">30 0x00007f2f2dfac8b8 in QQmlPrivate::QQmlElement<Plasma::DataSource>::~QQmlElement (this=0x552c060, __in_chrg=<optimized out>) at /home/jowenn/KDE/qt5/qtdeclarative/src/qml/qml/qqmlprivate.h:106</h1>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">31 0x00007f2f2dfac8e8 in QQmlPrivate::QQmlElement<Plasma::DataSource>::~QQmlElement (this=0x552c060, __in_chrg=<optimized out>) at /home/jowenn/KDE/qt5/qtdeclarative/src/qml/qml/qqmlprivate.h:106</h1></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This part of plasma shell does not cause a crash for me anymore.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/declarativeimports/core/datasource.cpp <span style="color: grey">(2e7a2af4919f85bb385e95f2a29f9cdb5e7ecfda)</span></li>

 <li>src/declarativeimports/core/datasource.h <span style="color: grey">(3a8b522919f04f8581e98271aff55ccc001062c8)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/120110/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>




  </div>
 </body>
</html>