From 83064cd40b3bd50ed3bee890890c2f4b2701cf36 Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Tue, 12 May 2026 09:33:57 +0200 Subject: [PATCH] fix(autotranslate): mark warmup thread as IsBackground F9.2: PreloadCache spawned a new Thread without IsBackground, which kept the plugin unload blocked until the warmup finished (typically 100-300 ms). Setting IsBackground=true plus a named thread matches the pattern already used in MessageManager (F6.1) and Plugin.RetentionSweep (F9.3) since v1.4.0. --- HellionChat/Util/AutoTranslate.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/HellionChat/Util/AutoTranslate.cs b/HellionChat/Util/AutoTranslate.cs index e0a940c..fa4e0b5 100644 --- a/HellionChat/Util/AutoTranslate.cs +++ b/HellionChat/Util/AutoTranslate.cs @@ -54,15 +54,21 @@ internal static class AutoTranslate } // Warms the auto-translate cache on a background thread so the first - // message send doesn't hitch the main thread. + // message send doesn't hitch the main thread. IsBackground keeps plugin + // unload non-blocking even if the warmup is still in flight. internal static void PreloadCache() { - new Thread(() => + var thread = new Thread(() => { var sw = Stopwatch.StartNew(); AllEntries(); Plugin.Log.Debug($"Warming up auto-translate took {sw.ElapsedMilliseconds}ms"); - }).Start(); + }) + { + IsBackground = true, + Name = "HellionChat-AutoTranslate-Warmup", + }; + thread.Start(); } private static List AllEntries()