From 78d11f8a71383232a1de160f3e454c59af5bcbf0 Mon Sep 17 00:00:00 2001 From: Max Klein Date: Tue, 23 Jun 2020 17:01:02 +0200 Subject: [PATCH] LegendItem: fix clear() not closing widgets --- pyqtgraph/graphicsItems/LegendItem.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyqtgraph/graphicsItems/LegendItem.py b/pyqtgraph/graphicsItems/LegendItem.py index da830782..55057fa6 100644 --- a/pyqtgraph/graphicsItems/LegendItem.py +++ b/pyqtgraph/graphicsItems/LegendItem.py @@ -189,7 +189,9 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor): """Remove all items from the legend.""" for sample, label in self.items: self.layout.removeItem(sample) + sample.close() self.layout.removeItem(label) + label.close() self.items = [] self.updateSize()