<table><tr><td style="">apol 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/D11438">View Revision</a></tr></table><br /><div><div><p>I agree that the problem is somewhere over there, but I can't put he finger on it. I don't think the shared pointer is going to entirely solve the issue though.<br />
Notifications are dbus interfaces, keeping them alive after they are deleted won't do much good. I had this proof of concept locally to see if it was better, and it seems better but not really.</p>

<p>Also I haven't had a crash since the last fix, I do see empty notifications on the plasmoid sometimes though.</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="diff" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><span style="color: #000080">diff --git a/plugins/notifications/notificationsdbusinterface.cpp b/plugins/notifications/notificationsdbusinterface.cpp</span>
<span style="color: #000080">index 343d1149..fc3d83a2 100644</span>
<span style="color: #a00000">--- a/plugins/notifications/notificationsdbusinterface.cpp</span>
<span style="color: #00a000">+++ b/plugins/notifications/notificationsdbusinterface.cpp</span>
<span style="color: #800080">@@ -69,6 +69,7 @@ void NotificationsDbusInterface::processPacket(const NetworkPacket& np)</span>
 
         if (!m_internalIdToPublicId.contains(id)) {
             Notification* noti = new Notification(np, this);
<span style="color: #00a000">+            connect(noti, &QObject::destroyed, this, [this, id](){ removeNotification(id); });</span>
 
             if (noti->isReady()) {
                 addNotification(noti);
<span style="color: #000080">diff --git a/plugins/notifications/notificationsdbusinterface.h b/plugins/notifications/notificationsdbusinterface.h</span>
<span style="color: #000080">index 0cf23c63..fdb3d2a9 100644</span>
<span style="color: #a00000">--- a/plugins/notifications/notificationsdbusinterface.h</span>
<span style="color: #00a000">+++ b/plugins/notifications/notificationsdbusinterface.h</span>
<span style="color: #800080">@@ -66,7 +66,7 @@ private /*methods*/:</span>
 private /*attributes*/:
     const Device* m_device;
     KdeConnectPlugin* m_plugin;
<span style="color: #a00000">-    QHash<QString, QPointer<Notification>> m_notifications;</span>
<span style="color: #00a000">+    QHash<QString, Notification*> m_notifications;</span>
     QHash<QString, QString> m_internalIdToPublicId;
     int m_lastId;
 };</pre></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R224 KDE Connect</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D11438">https://phabricator.kde.org/D11438</a></div></div><br /><div><strong>To: </strong>mtijink, KDE Connect<br /><strong>Cc: </strong>apol, nicolasfella, KDE Connect<br /></div>