Load services asynchronously whenever possible (#893)

This commit is contained in:
kizer 2022-06-25 05:12:51 +09:00 committed by GitHub
parent fba8c7163c
commit 8e7f370ddd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 959 additions and 899 deletions

View file

@ -20,15 +20,6 @@ namespace Dalamud.Game
/// </summary>
protected bool IsResolved { get; set; }
/// <summary>
/// Setup the resolver, calling the appopriate method based on the process architecture.
/// </summary>
public void Setup()
{
var scanner = Service<SigScanner>.Get();
this.Setup(scanner);
}
/// <summary>
/// Setup the resolver, calling the appopriate method based on the process architecture.
/// </summary>
@ -55,11 +46,13 @@ namespace Dalamud.Game
this.SetupInternal(scanner);
var className = this.GetType().Name;
DebugScannedValues[className] = new List<(string, IntPtr)>();
var list = new List<(string, IntPtr)>();
lock (DebugScannedValues)
DebugScannedValues[className] = list;
foreach (var property in this.GetType().GetProperties().Where(x => x.PropertyType == typeof(IntPtr)))
{
DebugScannedValues[className].Add((property.Name, (IntPtr)property.GetValue(this)));
list.Add((property.Name, (IntPtr)property.GetValue(this)));
}
this.IsResolved = true;