From 6826e2615ce13a1a73cf3f5c3448e2b29ed319f7 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 25 Jul 2018 10:07:24 -0700 Subject: [PATCH] Fix exit error caused by callback invoked during Qt teardown --- pyqtgraph/graphicsItems/GraphicsItem.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyqtgraph/graphicsItems/GraphicsItem.py b/pyqtgraph/graphicsItems/GraphicsItem.py index f88069bc..628b495b 100644 --- a/pyqtgraph/graphicsItems/GraphicsItem.py +++ b/pyqtgraph/graphicsItems/GraphicsItem.py @@ -445,6 +445,10 @@ class GraphicsItem(object): ## called to see whether this item has a new view to connect to ## NOTE: This is called from GraphicsObject.itemChange or GraphicsWidget.itemChange. + if not hasattr(self, '_connectedView'): + # Happens when Python is shutting down. + return + ## It is possible this item has moved to a different ViewBox or widget; ## clear out previously determined references to these. self.forgetViewBox()