diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 969b31938..5d31e60da 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -130,6 +130,7 @@ Fixed - (QtWebEngine) HTML fullscreen is now tracked for each tab separately, which means it's not possible anymore to accidentally get stuck in fullscreen state by closing a tab with a fullscreen video. +- For some people, running some userscripts crashed - this should now be fixed. - Various other rare crashes should now be fixed. - The settings documentation was truncated with v0.10.1 which should now be fixed. diff --git a/qutebrowser/commands/userscripts.py b/qutebrowser/commands/userscripts.py index f3802d04c..69a36f400 100644 --- a/qutebrowser/commands/userscripts.py +++ b/qutebrowser/commands/userscripts.py @@ -64,14 +64,19 @@ class _QtFIFOReader(QObject): def read_line(self): """(Try to) read a line from the FIFO.""" log.procs.debug("QSocketNotifier triggered!") - self._notifier.setEnabled(False) try: - for line in self._fifo: - self.got_line.emit(line.rstrip('\r\n')) - self._notifier.setEnabled(True) - except UnicodeDecodeError as e: - log.misc.error("Invalid unicode in userscript output: {}" - .format(e)) + self._notifier.setEnabled(False) + try: + for line in self._fifo: + self.got_line.emit(line.rstrip('\r\n')) + self._notifier.setEnabled(True) + except UnicodeDecodeError as e: + log.misc.error("Invalid unicode in userscript output: {}" + .format(e)) + except RuntimeError as e: + # For unknown reasons, read_line can still get called after the + # QSocketNotifier was already deleted... + log.procs.debug("While reading userscript output: {}".format(e)) def cleanup(self): """Clean up so the FIFO can be closed."""