]> sigrok.org Git - sigrok-meter.git/commitdiff
Return from sample callback if sigrok module is not available.
authorJens Steinhauser <redacted>
Mon, 17 Nov 2014 15:40:58 +0000 (16:40 +0100)
committerJens Steinhauser <redacted>
Tue, 18 Nov 2014 15:11:41 +0000 (16:11 +0100)
sigrok-meter

index 8501cfa65ba0c68e727b2d981e168b6e4d309e5a..f9ea82b868a7d19e2d95ba0eb2d69dd10b0aef46 100755 (executable)
@@ -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)