From 3b94875a7fdac4a5e5d7a6a4f0a6d1f466b879de Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Thu, 29 Feb 2024 02:04:54 +0100 Subject: [PATCH] ContextWindow: Dispose context after creating new one --- Elwig/Windows/ContextWindow.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Elwig/Windows/ContextWindow.cs b/Elwig/Windows/ContextWindow.cs index 1a8c732..f255deb 100644 --- a/Elwig/Windows/ContextWindow.cs +++ b/Elwig/Windows/ContextWindow.cs @@ -46,10 +46,11 @@ namespace Elwig.Windows { protected async Task RenewContext() { if (!_renewPending) return; - Context.Dispose(); + var old = Context; Context = new(); await OnRenewContext(); _renewPending = false; + old.Dispose(); } abstract protected Task OnRenewContext();