diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2009-09-28 15:27:19 (GMT) |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2009-09-29 10:41:51 (GMT) |
commit | 5e27598e241ddfef2f1ae1f19c4e1e90eb84992a (patch) | |
tree | 56871bc4fc8095f399f420b84784d8fde3376968 /src/3rdparty/webkit/WebKit | |
parent | bb917438a942da68e065a4810b29697a1340cdd6 (diff) | |
download | Qt-5e27598e241ddfef2f1ae1f19c4e1e90eb84992a.zip Qt-5e27598e241ddfef2f1ae1f19c4e1e90eb84992a.tar.gz Qt-5e27598e241ddfef2f1ae1f19c4e1e90eb84992a.tar.bz2 |
Re-apply change e433f472a765d738238a6b380060ce15c4910148 by Jedrzej Nowacki
Fix QWebHistory autotest crashes
https://bugs.webkit.org/show_bug.cgi?id=29803
Reviewed-by: Simon Hausmann
Cherry-picked-by: Simon Hausmann
Diffstat (limited to 'src/3rdparty/webkit/WebKit')
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index aad718b..45a38c6 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -1491,9 +1491,11 @@ QWebPage::QWebPage(QObject *parent) */ QWebPage::~QWebPage() { - FrameLoader *loader = d->mainFrame->d->frame->loader(); - if (loader) - loader->detachFromParent(); + if (d->mainFrame) { + FrameLoader *loader = d->mainFrame->d->frame->loader(); + if (loader) + loader->detachFromParent(); + } if (d->inspector) d->inspector->setPage(0); delete d; @@ -1520,6 +1522,7 @@ QWebFrame *QWebPage::mainFrame() const */ QWebFrame *QWebPage::currentFrame() const { + d->createMainFrame(); return static_cast<WebCore::FrameLoaderClientQt *>(d->page->focusController()->focusedOrMainFrame()->loader()->client())->webFrame(); } @@ -1545,6 +1548,7 @@ QWebFrame* QWebPage::frameAt(const QPoint& pos) const */ QWebHistory *QWebPage::history() const { + d->createMainFrame(); return &d->history; } |