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

Jonathan Marten noreply at phabricator.kde.org
Thu Mar 7 09:37:11 GMT 2019


marten updated this revision to Diff 53340.
marten retitled this revision from "Explicitly delete MailWebEnginePage to avoid crash on KMail exit or viewer window close" to "Reassign ownership of QWebEngineProfile in MailWebEnginePage, to avoid crash on KMail exit or viewer window close".
marten added a comment.


  Yes, doing that seems to work.  It's not as elegant an implementation as it could be, because the QWebEngineProfile still needs to be created by MailWebEngineView and passed to the MailWebEnginePage which adopts it as a child.  It's not possible to manage the profile entirely within MailWebEnginePage because a profile can only be set when a QWebEnginePage is created, and trying to do that in the constructor:
  
    MailWebEnginePage::MailWebEnginePage(QObject *parent)
      : WebEngineViewer::WebEnginePage(new QWebEngineProfile(this), parent)
    {
      initialise();
    }
  
  crashes because the profile attempts to call back into the QWebEnginePage which is not fully constructed yet.

REPOSITORY
  R94 PIM: Message Library

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D19559?vs=53282&id=53340

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

AFFECTED FILES
  messageviewer/src/viewer/webengine/mailwebenginepage.cpp
  messageviewer/src/viewer/webengine/mailwebenginepage.h
  messageviewer/src/viewer/webengine/mailwebengineview.cpp

To: marten, #kde_pim
Cc: 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/3411fd52/attachment.html>


More information about the kde-pim mailing list