[Differential] [Updated, 4 lines] D2602: Fix possible memory leaks and dangling pointers

dkurz (Denis Kurz) noreply at phabricator.kde.org
Mon Aug 29 08:41:19 BST 2016


dkurz updated the summary for this revision.
dkurz updated the test plan for this revision.
dkurz updated this revision to Diff 6344.
dkurz added a comment.


  With raw pointers, we have no way of telling if an object on the heap was deleted by its parent. On the other hand, QPointers are reset to null, which is easily detectable. The Q_ASSERTs make sure that everything was deleted as intended, and they would not work with raw pointers, because they would definitely still point to the location where the deleted objects were once created.
  
  But I can see that you are still not convinced, which is fine. Even if I had convinced you, the Q_ASSERT patch should probably have been a patch of its own anyway.
  
  The new patch only fixes the memory problems. When creating it, I realized  that the old patch did only fix one of them, because I uploaded an old version, sorry for that.
  
  I updated the summary accordingly. If the patch is OK now, please commit it for me, since I do not have commit access.

REPOSITORY
  rKDEPIM KDE PIM

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D2602?vs=6318&id=6344

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

AFFECTED FILES
  kmail/src/kmmainwidget.cpp

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: dkurz, #kde_pim
Cc: mlaurent, kde-pim, spencerb, dvasin, winterz, smartins, vkrause, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20160829/289e4151/attachment.html>


More information about the kde-pim mailing list