We now always create a new socket on terminate

CURA-2127
This commit is contained in:
Jaime van Kessel 2016-08-22 10:32:49 +02:00
parent a01a541c5d
commit bfc01827c2

View file

@ -195,9 +195,8 @@ class CuraEngineBackend(Backend):
self.slicingCancelled.emit()
self.processingProgress.emit(0)
Logger.log("d", "Attempting to kill the engine process")
self._createSocket() # Ensure that we have a fresh socket.
if Application.getInstance().getCommandLineOption("external-backend", False):
self._createSocket()
return
if self._process is not None:
@ -206,6 +205,7 @@ class CuraEngineBackend(Backend):
self._process.terminate()
Logger.log("d", "Engine process is killed. Received return code %s", self._process.wait())
self._process = None
except Exception as e: # terminating a process that is already terminating causes an exception, silently ignore this.
Logger.log("d", "Exception occurred while trying to kill the engine %s", str(e))