ContextWindow: Dispose context after creating new one
This commit is contained in:
@ -46,10 +46,11 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
protected async Task RenewContext() {
|
protected async Task RenewContext() {
|
||||||
if (!_renewPending) return;
|
if (!_renewPending) return;
|
||||||
Context.Dispose();
|
var old = Context;
|
||||||
Context = new();
|
Context = new();
|
||||||
await OnRenewContext();
|
await OnRenewContext();
|
||||||
_renewPending = false;
|
_renewPending = false;
|
||||||
|
old.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract protected Task OnRenewContext();
|
abstract protected Task OnRenewContext();
|
||||||
|
Reference in New Issue
Block a user