Fix closing with no last-visible-main-window

Fixes #1918
This commit is contained in:
Florian Bruhin 2016-09-11 15:59:50 +02:00
parent 11ee5befcc
commit 162e6d6483
2 changed files with 6 additions and 5 deletions

View File

@ -156,6 +156,7 @@ Fixed
- The tabbar now displays correctly with the Adwaita Qt theme
- The default `sk` keybinding now sets the commandline to `:bind` correctly
- Fixed hang when using multiple spaces in a row with the URL completion
- Fixed crash when closing a window without focusing it
v0.8.3 (unreleased)
-------------------

View File

@ -492,12 +492,12 @@ class MainWindow(QWidget):
def _do_close(self):
"""Helper function for closeEvent."""
last_visible = objreg.get('last-visible-main-window')
if self is last_visible:
try:
try:
last_visible = objreg.get('last-visible-main-window')
if self is last_visible:
objreg.delete('last-visible-main-window')
except KeyError:
pass
except KeyError:
pass
objreg.get('session-manager').save_last_window_session()
self._save_geometry()
log.destroy.debug("Closing window {}".format(self.win_id))