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

Anthony Fieroni noreply at phabricator.kde.org
Fri Jun 23 08:22:05 UTC 2017


anthonyfieroni added a comment.


  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 :)

INLINE COMMENTS

> projectselectionpage.cpp:335
> +        new KNS3::DownloadDialog(QStringLiteral("kdevappwizard.knsrc"), this);
> +    dialog->exec();
>  

Check should be done on every exec afterwards dialog is used, cause potentially it can be deleted

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/b55a4f3d/attachment.html>


More information about the KDevelop-devel mailing list