diff --git a/qutebrowser/widgets/browser.py b/qutebrowser/widgets/browser.py index 67003321d..f24df6d88 100644 --- a/qutebrowser/widgets/browser.py +++ b/qutebrowser/widgets/browser.py @@ -73,6 +73,8 @@ class TabbedBrowser(TabWidget): space.setContext(Qt.WidgetWithChildrenShortcut) space.activated.connect(self.space_scroll) self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) + self.tabCloseRequested.connect(lambda idx: + self.widget(idx).deleteLater()) def tabopen(self, url): """Open a new tab with a given url. @@ -141,6 +143,8 @@ class TabbedBrowser(TabWidget): # FIXME maybe we actually should store the webview objects here self._url_stack.append(tab.url()) self.removeTab(idx) + # Mark the QWebView to be deleted later in the main Qt loop. + tab.deleteLater() else: # FIXME pass