From 135b9dc1e4b1ae8ea2b21f2d1e1e3c26f2a9e5c8 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 4 Jun 2023 11:47:07 +0800 Subject: [PATCH] IMKCandidates // Stop crashing on activating new session. --- Source/Modules/SessionCtl_Core.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Modules/SessionCtl_Core.swift b/Source/Modules/SessionCtl_Core.swift index be43b903..68753498 100644 --- a/Source/Modules/SessionCtl_Core.swift +++ b/Source/Modules/SessionCtl_Core.swift @@ -275,7 +275,9 @@ public extension SessionCtl { } DispatchQueue.main.async { // 清理掉上一個會話的選字窗及其選單。 - self.candidateUI = nil + if self.candidateUI is CtlCandidateTDK { + self.candidateUI = nil + } CtlCandidateTDK.currentMenu?.cancelTracking() CtlCandidateTDK.currentMenu = nil CtlCandidateTDK.currentWindow?.orderOut(nil)