mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
fix: type confusion when assigning dep getter tasks
This commit is contained in:
parent
5b10ecfc04
commit
53bfda3b33
2 changed files with 6 additions and 3 deletions
|
|
@ -10,6 +10,7 @@ using Dalamud.Game;
|
||||||
using Dalamud.Game.Gui.Internal;
|
using Dalamud.Game.Gui.Internal;
|
||||||
using Dalamud.Interface.Internal;
|
using Dalamud.Interface.Internal;
|
||||||
using Dalamud.Plugin.Internal;
|
using Dalamud.Plugin.Internal;
|
||||||
|
using Dalamud.Utility;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
|
@ -81,6 +82,7 @@ internal sealed class Dalamud : IServiceType
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.Error(e, "Service initialization failure");
|
Log.Error(e, "Service initialization failure");
|
||||||
|
Util.Fatal("Dalamud could not initialize correctly. Please report this error. \n\nThe game will continue, but you may not be able to use plugins.", "Dalamud", false);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -138,8 +138,9 @@ internal static class ServiceManager
|
||||||
|
|
||||||
Debug.Assert(!serviceKind.HasFlag(ServiceKind.ManualService), "Regular services should never end up here");
|
Debug.Assert(!serviceKind.HasFlag(ServiceKind.ManualService), "Regular services should never end up here");
|
||||||
|
|
||||||
var getTask = (Task)typeof(Service<>)
|
var genericWrappedServiceType = typeof(Service<>).MakeGenericType(serviceType);
|
||||||
.MakeGenericType(serviceType)
|
|
||||||
|
var getTask = (Task)genericWrappedServiceType
|
||||||
.InvokeMember(
|
.InvokeMember(
|
||||||
"GetAsync",
|
"GetAsync",
|
||||||
BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.Public,
|
BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.Public,
|
||||||
|
|
@ -149,7 +150,7 @@ internal static class ServiceManager
|
||||||
|
|
||||||
if (serviceKind.HasFlag(ServiceKind.BlockingEarlyLoadedService))
|
if (serviceKind.HasFlag(ServiceKind.BlockingEarlyLoadedService))
|
||||||
{
|
{
|
||||||
getAsyncTaskMap[typeof(Service<>).MakeGenericType(serviceType)] = getTask;
|
getAsyncTaskMap[serviceType] = getTask;
|
||||||
blockingEarlyLoadingServices.Add(serviceType);
|
blockingEarlyLoadingServices.Add(serviceType);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue