<table><tr><td style="">vkrause added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D14263">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D14263#295602" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D14263#295602</a>, <a href="https://phabricator.kde.org/p/dvratil/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@dvratil</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><p>In this case, the session thread is destroyed from a slot connected to <tt style="background: #ebebeb; font-size: 13px;">QApplication::aboutToQuit()</tt> signal (see <tt style="background: #ebebeb; font-size: 13px;">SessionPrivate</tt> ctor), so I think just checking if <tt style="background: #ebebeb; font-size: 13px;">session->d->sessionThread()</tt> returns a valid pointer in <tt style="background: #ebebeb; font-size: 13px;">ChangeNotificationDependenciesFactory</tt> should do the job, without having the execution to actually enter a method with invalid <tt style="background: #ebebeb; font-size: 13px;">this</tt> pointer.</p></div>
</blockquote>

<p>That doesn't seem to work, <tt style="background: #ebebeb; font-size: 13px;">this</tt> isn't detectable as invalid at this point,</p>

<p>#6  0x00000000000002a0 in  ()<br />
#7  0x00007f05e1ba0f43 in QMetaObject::invokeMethod(QObject*, char const*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) (obj=obj@entry=0x260e1c0, member=<optimized out>, member@entry=0x7f05e4f651e0 "doDestroyConnection", type=type@entry=Qt::BlockingQueuedConnection, ret=..., val0=..., val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at /data2/k/qt5/src/qtbase/src/corelib/kernel/qmetaobject.cpp:1474<br />
#8  0x00007f05e4e61907 in QMetaObject::invokeMethod(QObject*, char const*, Qt::ConnectionType, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) (obj=obj@entry=0x260e1c0, member=member@entry=0x7f05e4f651e0 "doDestroyConnection", type=type@entry=Qt::BlockingQueuedConnection, val0=..., val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at /k/qt5/inst/include/QtCore/qobjectdefs.h:444<br />
#9  0x00007f05e4ed36bf in Akonadi::SessionThread::destroyConnection(Akonadi::Connection*) (this=0x260e1c0, connection=<optimized out>) at /k/kde5/src/akonadi/src/core/sessionthread.cpp:85<br />
#10 0x00007f05e4eb02d7 in Akonadi::MonitorPrivate::~MonitorPrivate() (this=0x2523690, <u>in_chrg=<optimized out>) at /k/kde5/src/akonadi/src/core/monitor_p.cpp:66<br />
#11 0x00007f05e4eb03f9 in Akonadi::MonitorPrivate::~MonitorPrivate() (this=0x2523690, </u>in_chrg=<optimized out>) at /k/kde5/src/akonadi/src/core/monitor_p.cpp:64<br />
#12 0x00007f05e4ea3a46 in Akonadi::Monitor::~Monitor() (this=0x2561050, <u>in_chrg=<optimized out>) at /k/kde5/src/akonadi/src/core/monitor.cpp:61<br />
#13 0x00007f05e4ea3a59 in Akonadi::Monitor::~Monitor() (this=0x2561050, </u>in_chrg=<optimized out>) at /k/kde5/src/akonadi/src/core/monitor.cpp:57<br />
#14 0x00007f05e1bc172a in QObjectPrivate::deleteChildren() (this=this@entry=0x2600550) at /data2/k/qt5/src/qtbase/src/corelib/kernel/qobject.cpp:1997<br />
#15 0x00007f05e1bc2a9f in QObject::~QObject() (this=<optimized out>, <u>in_chrg=<optimized out>) at /data2/k/qt5/src/qtbase/src/corelib/kernel/qobject.cpp:1025<br />
#16 0x00007f05a6bdac39 in Akonadi::ETMCalendar::~ETMCalendar() (this=0x2550690, </u>in_chrg=<optimized out>) at /k/kde5/src/akonadi-calendar/src/etmcalendar.cpp:505</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R165 Akonadi </div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D14263">https://phabricator.kde.org/D14263</a></div></div><br /><div><strong>To: </strong>vkrause, dvratil<br /><strong>Cc: </strong>dvratil, kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss<br /></div>