D19559: Reassign ownership of QWebEngineProfile in MailWebEnginePage, to avoid crash on KMail exit or viewer window close

Anthony Fieroni noreply at phabricator.kde.org
Thu Mar 7 11:55:02 GMT 2019


anthonyfieroni added inline comments.

INLINE COMMENTS

> mailwebenginepage.cpp:40
> +    // Deleting it as our child on destruction is safe.
> +    profile->setParent(this);
>      initialize();

It should be done in WebEngineViewer::WebEnginePage, to be applied to all pages not only to Mail.

> mailwebengineview.cpp:83-87
>  {
> -    d->mPageEngine = new MailWebEnginePage(new QWebEngineProfile(this), this);
> +    // Do not create the QWebEngineProfile as a child of us, the MailWebEnginePage
> +    // will take ownershp of it and ensure that it it correctly deleted during
> +    // destruction.
> +    d->mPageEngine = new MailWebEnginePage(new QWebEngineProfile, this);

It's not needed to change these lines, while you reparent inside.

REPOSITORY
  R94 PIM: Message Library

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

To: marten, #kde_pim
Cc: anthonyfieroni, dvratil, kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20190307/ce94e3c0/attachment.html>


More information about the kde-pim mailing list