From d44ff5ba01bea65444b96a05eb5252a39b99824f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 25 Feb 2018 15:53:01 +0100 Subject: [PATCH] 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. --- doc/changelog.asciidoc | 1 + qutebrowser/mainwindow/tabbedbrowser.py | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 2f1a1f1db..13636f3b2 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -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. diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index 8cee35524..299a5fb08 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -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)