mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
fix: don't handle scoped services in ServiceManager.UnloadAllServices()
Fixes a deadlock while unloading
This commit is contained in:
parent
b80681e3e1
commit
34bb2a7ad4
1 changed files with 7 additions and 0 deletions
|
|
@ -309,6 +309,13 @@ internal static class ServiceManager
|
||||||
if (!serviceType.IsAssignableTo(typeof(IServiceType)))
|
if (!serviceType.IsAssignableTo(typeof(IServiceType)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Scoped services shall never be unloaded here.
|
||||||
|
// Their lifetime must be managed by the IServiceScope that owns them. If it leaks, it's their fault.
|
||||||
|
if (serviceType.GetServiceKind() == ServiceKind.ScopedService)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Log.Verbose("Calling GetDependencyServices for '{ServiceName}'", serviceType.FullName!);
|
||||||
|
|
||||||
dependencyServicesMap[serviceType] =
|
dependencyServicesMap[serviceType] =
|
||||||
((List<Type>)typeof(Service<>)
|
((List<Type>)typeof(Service<>)
|
||||||
.MakeGenericType(serviceType)
|
.MakeGenericType(serviceType)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue