mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-13 23:24:15 +01:00
wait for plugin disposal
This commit is contained in:
parent
f7fca75e24
commit
12c5448b47
1 changed files with 3 additions and 1 deletions
|
|
@ -29,12 +29,13 @@ namespace MareSynchronos;
|
||||||
public sealed class Plugin : IDalamudPlugin
|
public sealed class Plugin : IDalamudPlugin
|
||||||
{
|
{
|
||||||
private readonly CancellationTokenSource _pluginCts = new();
|
private readonly CancellationTokenSource _pluginCts = new();
|
||||||
|
private Task _hostBuilderRunTask;
|
||||||
|
|
||||||
public Plugin(DalamudPluginInterface pluginInterface, ICommandManager commandManager, IDataManager gameData,
|
public Plugin(DalamudPluginInterface pluginInterface, ICommandManager commandManager, IDataManager gameData,
|
||||||
IFramework framework, IObjectTable objectTable, IClientState clientState, ICondition condition, IChatGui chatGui,
|
IFramework framework, IObjectTable objectTable, IClientState clientState, ICondition condition, IChatGui chatGui,
|
||||||
IGameGui gameGui, IDtrBar dtrBar, IPluginLog pluginLog)
|
IGameGui gameGui, IDtrBar dtrBar, IPluginLog pluginLog)
|
||||||
{
|
{
|
||||||
_ = new HostBuilder()
|
_hostBuilderRunTask = new HostBuilder()
|
||||||
.UseContentRoot(pluginInterface.ConfigDirectory.FullName)
|
.UseContentRoot(pluginInterface.ConfigDirectory.FullName)
|
||||||
.ConfigureLogging(lb =>
|
.ConfigureLogging(lb =>
|
||||||
{
|
{
|
||||||
|
|
@ -153,5 +154,6 @@ public sealed class Plugin : IDalamudPlugin
|
||||||
{
|
{
|
||||||
_pluginCts.Cancel();
|
_pluginCts.Cancel();
|
||||||
_pluginCts.Dispose();
|
_pluginCts.Dispose();
|
||||||
|
Task.WaitAny(_hostBuilderRunTask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue