summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api/qwebenginepage.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-06-30 16:22:33 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-07-01 11:26:25 +0000
commitea503a2f07f2505d8d91a7d7999a1fb1b1d6b57c (patch)
tree94267598ac36bcf587ed4e54ed12d7c4b5749b46 /src/webenginewidgets/api/qwebenginepage.cpp
parent5b219fc20dbfe6090af45c1dbdb7ad50bc743ca1 (diff)
Let script collection hold a reference to the adapter
While the script collection always follows a page, it is safer to have both hold a reference to the web-contents adapter, so it doesn't get deleted while adapters are being changed. Change-Id: I21e268f7228f13702468df61e0032bdf2f99873a Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/webenginewidgets/api/qwebenginepage.cpp')
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 0d556f15b..b35bb54ec 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -288,8 +288,6 @@ void QWebEnginePagePrivate::adoptNewWindow(WebContentsAdapter *newWebContents, W
// Overwrite the new page's WebContents with ours.
if (newPage->d_func() != this) {
- // Keep the old adapter referenced until the scriptcollection is rebound
- QExplicitlySharedDataPointer<WebContentsAdapter> oldWebContents = newPage->d_func()->adapter;
newPage->d_func()->adapter = newWebContents;
newWebContents->initialize(newPage->d_func());
newPage->d_func()->scriptCollection.d->rebindToContents(newWebContents);
@@ -455,9 +453,6 @@ void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input)
{
QExplicitlySharedDataPointer<WebContentsAdapter> newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this);
if (newWebContents) {
- // Keep the old adapter referenced so the user-scripts are not
- // unregistered immediately.
- QExplicitlySharedDataPointer<WebContentsAdapter> oldWebContents = adapter;
adapter = newWebContents.data();
adapter->initialize(this);
if (webChannel)