mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-22 06:03:57 -06:00
Make sure we properly restart the backend when it quits on itself
This prevents issues where the backend would not properly restart
This commit is contained in:
parent
e8ada1fd06
commit
69d8160207
1 changed files with 8 additions and 0 deletions
|
@ -76,6 +76,8 @@ class CuraEngineBackend(Backend):
|
||||||
|
|
||||||
self._message = None
|
self._message = None
|
||||||
|
|
||||||
|
self.backendQuit.connect(self._onBackendQuit)
|
||||||
|
|
||||||
self.backendConnected.connect(self._onBackendConnected)
|
self.backendConnected.connect(self._onBackendConnected)
|
||||||
Application.getInstance().getController().toolOperationStarted.connect(self._onToolOperationStarted)
|
Application.getInstance().getController().toolOperationStarted.connect(self._onToolOperationStarted)
|
||||||
Application.getInstance().getController().toolOperationStopped.connect(self._onToolOperationStopped)
|
Application.getInstance().getController().toolOperationStopped.connect(self._onToolOperationStopped)
|
||||||
|
@ -151,6 +153,7 @@ class CuraEngineBackend(Backend):
|
||||||
Logger.log("d", "Killing engine process")
|
Logger.log("d", "Killing engine process")
|
||||||
try:
|
try:
|
||||||
self._process.terminate()
|
self._process.terminate()
|
||||||
|
self._process = None
|
||||||
except: # terminating a process that is already terminating causes an exception, silently ignore this.
|
except: # terminating a process that is already terminating causes an exception, silently ignore this.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -265,3 +268,8 @@ class CuraEngineBackend(Backend):
|
||||||
def _onInstanceChanged(self):
|
def _onInstanceChanged(self):
|
||||||
self._terminate()
|
self._terminate()
|
||||||
self.slicingCancelled.emit()
|
self.slicingCancelled.emit()
|
||||||
|
|
||||||
|
def _onBackendQuit(self):
|
||||||
|
if not self._restart and self._process:
|
||||||
|
self._process = None
|
||||||
|
self._createSocket()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue