diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-07-08 14:24:42 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-07-08 13:34:27 +0000 |
commit | 3855015600418107485b31b0ec2bfa5b987787e7 (patch) | |
tree | 1c06e1c6e4ffcadfc46419a9557175ca378c4d54 /src/webenginewidgets/api/qwebenginepage_p.h | |
parent | 7f261437d6a60d1f53624b68ed88fb32bf8c5f1c (diff) |
Allow QWebEnginePage::createWindow to return this
Consider a QWebEnginePage subclass that does "return this;" in
createWindow. Commit 1f07d2929a made this a no-op to prevent QtWebEngine
from crashing. The reason for the crash was access to deleted memory
after destroying the current adapter in adoptNewWindow.
Defer the adoption in this case to whenever we hit the event loop
again.
Change-Id: I9674d80ef8b2f301c1446ff505b2486649451ba6
Task-number: QTBUG-42216
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/webenginewidgets/api/qwebenginepage_p.h')
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index 41ba84dd0..27f582c30 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -96,6 +96,9 @@ public: virtual void focusContainer() Q_DECL_OVERRIDE; virtual void unhandledKeyEvent(QKeyEvent *event) Q_DECL_OVERRIDE; virtual void adoptNewWindow(QSharedPointer<QtWebEngineCore::WebContentsAdapter> newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry) Q_DECL_OVERRIDE; + void adoptNewWindowImpl(QWebEnginePage *newPage, + const QSharedPointer<QtWebEngineCore::WebContentsAdapter> &newWebContents, + const QRect &initialGeometry); virtual bool isBeingAdopted() Q_DECL_OVERRIDE; virtual void close() Q_DECL_OVERRIDE; virtual void windowCloseRejected() Q_DECL_OVERRIDE; |