From: Jens Steinhauser Date: Mon, 17 Nov 2014 15:40:58 +0000 (+0100) Subject: Return from sample callback if sigrok module is not available. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=2f050135e86497a757fe1e0e3ee9b40193405ac3;p=sigrok-meter.git Return from sample callback if sigrok module is not available. --- diff --git a/sigrok-meter b/sigrok-meter index 8501cfa..f9ea82b 100755 --- a/sigrok-meter +++ b/sigrok-meter @@ -173,6 +173,12 @@ class SamplingThread(QtCore.QObject): self.session.stop() def callback(self, device, packet): + if not sr: + # In rare cases it can happen that the callback fires while + # the interpreter is shutting down. Then the sigrok module + # is already set to 'None'. + return + if packet.type == sr.PacketType.ANALOG: self.measured.emit(device, packet.payload)