ContextWindow: Dispose context after creating new one
This commit is contained in:
@ -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