From: Youness Alaoui Date: Mon, 7 Dec 2015 19:58:00 +0000 (-0500) Subject: Fix issue where a line could be sent twice due to race condition X-Git-Tag: lulzbot-18.03~8 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=fa9db4e79d9f9eb5c57195f86d043a86123f8c1a;p=cura.git Fix issue where a line could be sent twice due to race condition --- diff --git a/Cura/util/machineCom.py b/Cura/util/machineCom.py index 0282fd7c..d1327d13 100644 --- a/Cura/util/machineCom.py +++ b/Cura/util/machineCom.py @@ -614,8 +614,9 @@ class MachineCom(object): except: self._log("Unexpected error: %s" % (getExceptionString())) checksum = reduce(lambda x,y:x^y, map(ord, "N%d%s" % (self._gcodePos, line))) - self._sendCommand("N%d%s*%d" % (self._gcodePos, line, checksum)) + pos = self._gcodePos self._gcodePos += 1 + self._sendCommand("N%d%s*%d" % (pos, line, checksum)) self._callback.mcProgress(self._gcodePos) def sendCommand(self, cmd):