From 309eadd0a85847a69a96ef4c26df810437eca647 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Fri, 8 Dec 2023 10:26:13 +0100 Subject: [PATCH] docs: close matplotlib figure to avoid memory leak --- solara/website/pages/examples/general/live_update.py | 1 + 1 file changed, 1 insertion(+) diff --git a/solara/website/pages/examples/general/live_update.py b/solara/website/pages/examples/general/live_update.py index 450920a45..226527a73 100644 --- a/solara/website/pages/examples/general/live_update.py +++ b/solara/website/pages/examples/general/live_update.py @@ -35,6 +35,7 @@ def LiveUpdatingComponent(counter): """Component which will be redrawn whenever the counter value changes.""" fig, ax = plt.subplots() ax.plot(np.arange(10), np.random.random(10)) + plt.close(fig) solara.FigureMatplotlib(fig)