Don't load the URL immediately on :undo

On some pages like Qt's Gerrit, Indiegogo or Telegram Web, this caused a crash
with QtWebEngine and Qt 5.10.1 in
QtWebEngineCore::WebContentsAdapter::webContents().

I'm not sure what causes the crash exactly, but I'm guessing it's some kind of
race condition between loading the URL initially and deserializing the history,
which both ends up loading the URL.

Since restoring the history means we end up on the given URL anyways, let's just
not open the URL beforehand, which seems to fix this.

Fixes #3619.
This commit is contained in:
Florian Bruhin 2018-02-25 15:53:01 +01:00
parent ada15510a7
commit d44ff5ba01
2 changed files with 2 additions and 3 deletions

View File

@ -76,6 +76,7 @@ Fixed
- QtWebEngine: Hinting and scrolling now works properly on special
`view-source:` pages.
- QtWebEngine: Scroll positions are now restored correctly from sessions.
- QtWebEngine: Crash with Qt 5.10.1 when using :undo on some tabs.
- QtWebKit: `:view-source` now displays a valid URL.
- URLs containing ampersands and other special chars are now shown
correctly when filtering them in the completion.

View File

@ -378,12 +378,10 @@ class TabbedBrowser(tabwidget.TabWidget):
for entry in reversed(self._undo_stack.pop()):
if use_current_tab:
self.openurl(entry.url, newtab=False)
newtab = self.widget(0)
use_current_tab = False
else:
newtab = self.tabopen(entry.url, background=False,
idx=entry.index)
newtab = self.tabopen(background=False, idx=entry.index)
newtab.history.deserialize(entry.history)
self.set_tab_pinned(newtab, entry.pinned)