ContextWindow: Dispose context after creating new one
This commit is contained in:
1 parent
d897e44f3b
commit
3b94875a7f
1 file changed
+2
-1
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user