From b43d4b89934b0720983165cc3a572814f6d41603 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Mon, 10 Oct 2022 11:59:43 +0800 Subject: [PATCH] SessionCtl // Add warning comments towards handle(state). --- Source/Modules/SessionCtl_HandleStates.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Modules/SessionCtl_HandleStates.swift b/Source/Modules/SessionCtl_HandleStates.swift index e491db2e..521d55f5 100644 --- a/Source/Modules/SessionCtl_HandleStates.swift +++ b/Source/Modules/SessionCtl_HandleStates.swift @@ -16,6 +16,10 @@ extension SessionCtl { /// /// 先將舊狀態單獨記錄起來,再將新舊狀態作為參數, /// 根據新狀態本身的狀態種類來判斷交給哪一個專門的函式來處理。 + /// - Remark: ⚠️ 任何在這個函式當中被改變的變數均不得是靜態 (Static) 變數。 + /// 針對某一個客體的 deactivateServer() 可能會在使用者切換到另一個客體應用 + /// 且開始敲字之後才會執行。這個過程會使得不同的 SessionCtl 副本之間出現 + /// 不必要的互相干涉、打斷彼此的工作。 /// - Parameter newState: 新狀態。 func handle(state newState: IMEStateProtocol) { let previous = state