<table><tr><td style="">dkurz 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/D2602" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>I tried to motivate the move from raw to QPointers with the memory bugs I found. First, mTreeFolderWidget was not reset to Q_NULLPTR after it was deleted, although this pointer is used in nine places in kmmainwidget.cpp to check if that widget exists, and to access it afterwards. Second, mFolderModel was reset to Q_NULLPTR in deleteWidgets, although it was not destroyed there, so that model leaked. Both problems would not have happened with QPointers. The Q_ASSERTs help find such wrong assumptions that we rely on now.</p>

<p>Note also that the KMMailWidget code is not performance critical, so we can really afford to use the much safer QPointer. It does not add any complexity for programmers, too.</p>

<p>If this still does not convince you, I'll revert the QPointer move and just fix the two memory problems.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>rKDEPIM KDE PIM</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D2602" rel="noreferrer">https://phabricator.kde.org/D2602</a></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>dkurz, KDE PIM<br /><strong>Cc: </strong>mlaurent, kde-pim, spencerb, dvasin, winterz, smartins, vkrause, knauss, dvratil<br /></div>