From ea663f997515894115207249ea8dabda22da586f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 2 Oct 2015 08:08:03 +0200 Subject: [PATCH] IPC: Handle socket timeout correctly. Hopefully fixes #975. --- qutebrowser/misc/ipc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qutebrowser/misc/ipc.py b/qutebrowser/misc/ipc.py index 6c4eff848..e410002d4 100644 --- a/qutebrowser/misc/ipc.py +++ b/qutebrowser/misc/ipc.py @@ -342,7 +342,13 @@ class IPCServer(QObject): def on_timeout(self): """Cancel the current connection if it was idle for too long.""" log.ipc.error("IPC connection timed out.") - self._socket.close() + self._socket.disconnectFromServer() + if self._socket is not None: # pragma: no branch + # on_socket_disconnected sets it to None + self._socket.waitForDisconnected(100) + if self._socket is not None: # pragma: no branch + # on_socket_disconnected sets it to None + self._socket.abort() @pyqtSlot() def update_atime(self):