From 83276b9576a157b2046dd55491e4044dfa6764e3 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 11 Feb 2014 11:17:53 +0100 Subject: [PATCH] Delete QWebViews when tabs are closed. --- qutebrowser/widgets/browser.py | 4 ++++ 1 file changed, 4 insertions(+) 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