From 71bf9fdcf256491b2bacc83cfe56ad74d4a098f4 Mon Sep 17 00:00:00 2001 From: goat Date: Mon, 22 May 2023 21:34:43 +0200 Subject: [PATCH] fix: PM should not depend on scoped plugin services, their lifetime is managed by scopes --- Dalamud/Service{T}.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dalamud/Service{T}.cs b/Dalamud/Service{T}.cs index 0e7d75369..a1a56a9f0 100644 --- a/Dalamud/Service{T}.cs +++ b/Dalamud/Service{T}.cs @@ -154,6 +154,10 @@ internal static class Service where T : IServiceType if (attr == null) continue; + // Scoped plugin services lifetime is tied to their scopes. They go away when LocalPlugin goes away. + if (serviceType.GetServiceKind() == ServiceManager.ServiceKind.ScopedService) + continue; + ServiceManager.Log.Verbose("PluginManager MUST depend on {Type}", serviceType.FullName!); res.Add(serviceType); }