Bugfix for service creation stalling itself.

This commit is contained in:
Ottermandias 2023-04-19 11:00:53 +02:00
parent e3c333dd22
commit 1364b39f65
2 changed files with 11 additions and 3 deletions

View file

@ -78,9 +78,14 @@ public abstract class AsyncServiceWrapper<T> : IServiceWrapper<T>
{
Service = service;
Penumbra.Log.Verbose($"[{Name}] Created.");
FinishedCreation?.Invoke();
_task = null;
}
});
_task.ContinueWith((t, x) =>
{
if (!_isDisposed)
FinishedCreation?.Invoke();
}, null);
}
protected AsyncServiceWrapper(string name, Func<T> factory)
@ -99,9 +104,13 @@ public abstract class AsyncServiceWrapper<T> : IServiceWrapper<T>
Service = service;
Penumbra.Log.Verbose($"[{Name}] Created.");
_task = null;
FinishedCreation?.Invoke();
}
});
_task.ContinueWith((t, x) =>
{
if (!_isDisposed)
FinishedCreation?.Invoke();
}, null);
}
public void Dispose()