D6308: Fix crashy dialogs (found by krazy and by hand)

Christoph Roick noreply at phabricator.kde.org
Fri Jun 23 21:50:02 UTC 2017


croick added a comment.


  In https://phabricator.kde.org/D6308#118881, @anthonyfieroni wrote:
  
  > You still can make a wrapper around QPointer prevent call delete after exec() check i.e.
  >
  >   template<class T>
  >   class QPointerWrapper
  >   {
  >   QPoniter<T> ptr;
  >   public:
  >       QPointerWrapper(T *rawPtr) : ptr(rawPtr) {}
  >       ~QPointerWrapper() { delete ptr; }
  >      QPointer<T>& operator->() { return ptr; }
  >   };
  >   // usage
  >   QPointerWrapper<VcsCommitDialog> commitDialog = new VcsCommitDialog(patchSource);
  >   commitDialog->exec();
  >   // without delete commitDialog :)
  >
  
  
  Good point! I used that inside the functions now, since it only occurs twice.
  
  For the rest, I hopefully excluded all parentless dialogs from the patch such that these remain two special cases.

REPOSITORY
  R33 KDevPlatform

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

To: croick, #kdevelop
Cc: anthonyfieroni, kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170623/3c4368a1/attachment.html>


More information about the KDevelop-devel mailing list