From: daid Date: Sun, 2 Mar 2014 08:55:19 +0000 (+0100) Subject: Fix possible race-condition. X-Git-Tag: 14.03~20 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6647b001032f365a812ca4b11ed7b167b73076a0;p=cura.git Fix possible race-condition. --- diff --git a/Cura/util/sliceEngine.py b/Cura/util/sliceEngine.py index 432038dd..e99e22dc 100644 --- a/Cura/util/sliceEngine.py +++ b/Cura/util/sliceEngine.py @@ -347,17 +347,17 @@ class Engine(object): self._objCount += 1 modelHash = hash.hexdigest() if self._objCount > 0: - self._modelData = engineModelData - self._thread = threading.Thread(target=self._watchProcess, args=(commandList, self._thread, modelHash)) + self._thread = threading.Thread(target=self._watchProcess, args=(commandList, self._thread, engineModelData, modelHash)) self._thread.daemon = True self._thread.start() - def _watchProcess(self, commandList, oldThread, modelHash): + def _watchProcess(self, commandList, oldThread, engineModelData, modelHash): if oldThread is not None: if self._process is not None: self._process.terminate() oldThread.join() self._callback(-1.0) + self._modelData = engineModelData try: self._process = self._runEngineProcess(commandList) except OSError: @@ -367,6 +367,7 @@ class Engine(object): self._process.terminate() self._result = EngineResult() + self._result.addLog('Running: %s' % (' '.join(commandList))) self._result.setHash(modelHash) self._callback(0.0)