Shut down TabbedBrowser in MainWindow closeEvent.

Hopefully fixes #197.
This commit is contained in:
Florian Bruhin 2014-10-15 23:15:27 +02:00
parent 0209382df4
commit b4c7669e64
3 changed files with 4 additions and 6 deletions

View File

@ -638,12 +638,8 @@ class Application(QApplication):
self.removeEventFilter(self._event_filter)
except AttributeError:
pass
# Close all tabs
for win_id in objreg.window_registry:
log.destroy.debug("Closing tabs in window {}...".format(win_id))
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=win_id)
tabbed_browser.shutdown()
# Close all windows
QApplication.closeAllWindows()
# Shut down IPC
try:
objreg.get('ipc-server').shutdown()

View File

@ -333,3 +333,4 @@ class MainWindow(QWidget):
e.accept()
objreg.get('app').geometry = bytes(self.saveGeometry())
log.destroy.debug("Closing window {}".format(self.win_id))
self._tabbed_browser.shutdown()

View File

@ -264,6 +264,7 @@ class WebView(QWebView):
"""Shut down the webview."""
# We disable javascript because that prevents some segfaults when
# quitting it seems.
log.destroy.debug("Shutting down {!r}.".format(self))
settings = self.settings()
settings.setAttribute(QWebSettings.JavascriptEnabled, False)
self.stop()