refactor(di): drop manual PlatformUtil and LogProxy wiring (DI-3)
C3's Phase-1 bridge in Plugin.ctor already pulls IPlatformUtil and IPluginLogProxy out of the container right after the host builds, so the manual `new DalamudPlatformUtil()` / `new DalamudPluginLogProxy` assignments in Phase-0 were just allocating throwaway instances that got overwritten a few lines later. Phase-0 helpers that run before the container build (MigrateFromChatTwoLayout, LanguageChanged, ImGuiUtil.Initialize) do not touch Plugin.PlatformUtil or Plugin.LogProxy, so the brief null-window between the schema gate and the container build is safe. The DalamudPlatformUtil and DalamudPluginLogProxy wrapper classes themselves stay in the code; DI-4 (logger migration to ILogger<T>) will eventually retire the proxy for new sites but EmoteCache, AutoTranslate, MemoryUtil and WrapperUtil keep using it.
This commit is contained in:
@@ -193,11 +193,11 @@ public sealed class Plugin : IAsyncDalamudPlugin
|
||||
|
||||
Config = Interface.GetPluginConfig() as Configuration ?? new Configuration();
|
||||
|
||||
// Wire platform indirection before LoadAsync allocates anything that
|
||||
// needs Util.* — services then read Plugin.PlatformUtil instead of
|
||||
// hitting the Dalamud static surface directly.
|
||||
PlatformUtil = new DalamudPlatformUtil();
|
||||
LogProxy = new DalamudPluginLogProxy(Log);
|
||||
// PlatformUtil and LogProxy are filled from the DI container in
|
||||
// Phase-1 below (`_host.Services.GetRequiredService<IPlatformUtil>()`
|
||||
// and the LogProxy equivalent). Phase-0 helpers that run before that
|
||||
// point (MigrateFromChatTwoLayout, LanguageChanged, ImGuiUtil.Initialize)
|
||||
// do not touch either static, so the brief null-window is safe.
|
||||
|
||||
// Schema gate: v1.4.x requires config v16+. Users on older schemas
|
||||
// must install v1.4.2 first to run the migration chain. v17 adds
|
||||
|
||||
Reference in New Issue
Block a user