summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViktor Engelmann <viktor.engelmann@qt.io>2017-03-20 11:52:38 +0100
committerMichael BrĂ¼ning <michael.bruning@qt.io>2017-03-21 08:14:26 +0000
commitc554f3348cd0baea8221e668d41132cea0833a8a (patch)
treed8826c4e2f0953fc1531a39bed7a82ba70eb0af3
parent8e147ed3be7740092de233a2a7c67ec890069649 (diff)
Delegate QWebEngineHistory::currentItem() to itemAt()
Calling QWebEngineHistory::currentItem() before the first item is inserted, caused a segfault, due to accessing an illegal QList index. We now delegate the lookup to QWebEngineHistory::itemAt(), which checks the index first and returns a dummy element in case of an illegal index. Task-number: QTBUG-59599 Change-Id: I9cdd2533e33415a7b812c29fff5429eb005020dc Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
-rw-r--r--src/webenginewidgets/api/qwebenginehistory.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/webenginewidgets/api/qwebenginehistory.cpp b/src/webenginewidgets/api/qwebenginehistory.cpp
index 41de8c90b..48ddbc48e 100644
--- a/src/webenginewidgets/api/qwebenginehistory.cpp
+++ b/src/webenginewidgets/api/qwebenginehistory.cpp
@@ -226,9 +226,7 @@ QWebEngineHistoryItem QWebEngineHistory::backItem() const
QWebEngineHistoryItem QWebEngineHistory::currentItem() const
{
- Q_D(const QWebEngineHistory);
- d->updateItems();
- return d->items[currentItemIndex()];
+ return itemAt(currentItemIndex());
}
QWebEngineHistoryItem QWebEngineHistory::forwardItem() const